Example #1
0
        public GLSketchViewer(GraphicsInterface gi, int width, int height)
        {
            fDynamicTexture = new SnapNGLView.DynamicTexture(gi, width, height, 3);

            // Create the backing buffer to retain the image
            backingBuffer = new PixelBuffer24(width, height);
            //backingBuffer.DeviceContext.ClearToWhite();

            // 1.  Show a dialog box to allow the user to type in the 
            // group IP address and port number.
            HostForm groupForm = new HostForm();
            groupForm.ShowDialog();

            // 2. Get the address and port from the form, and use
            // them to setup the MultiSession object
            string groupIP = groupForm.groupAddressField.Text;
            int groupPort = int.Parse(groupForm.groupPortField.Text);
            IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(groupIP), groupPort);

            // Create the session
            fSession = new MultiSession(Guid.NewGuid().ToString(), ipep);

            // Add the channel for graphics commands
            fSketchChannel = fSession.CreateChannel(PayloadType.Whiteboard);

            // 3. Setup the chunk decoder so we can receive new images
            // when they come in
            fChunkDecoder = new GraphPortChunkDecoder(backingBuffer, fSketchChannel);
            fChunkDecoder.PixBltPixelBuffer24Handler += this.PixBltPixelBuffer24;
            fChunkDecoder.PixBltLumbHandler += this.PixBltLum24;

            //fSketchChannel.FrameReceivedEvent += FrameReceived;

        }
Example #2
0
        public Form1()
            : base("Snap N Viewer", 20, 20, 640, 480)
        {
            fAutoScale = true;

            // Create the backing buffer to retain the image
            fBackingBuffer = new GDIDIBSection(1600, 1200);

            // 1.  Show a dialog box to allow the user to type in the 
            // group IP address and port number.
            HostForm groupForm = new HostForm();
            //groupForm.ShowDialog();

            // 2. Get the address and port from the form, and use
            // them to setup the MultiSession object
            string groupIP = groupForm.groupAddressField.Text;
            int groupPort = int.Parse(groupForm.groupPortField.Text);
            IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(groupIP), groupPort);

            Title = "Snap N Viewer - " + ipep.ToString();

            fSession = new MultiSession(Guid.NewGuid().ToString(), ipep);
            fSketchChannel = fSession.CreateChannel(PayloadType.dynamicPresentation);

            // 3. Setup the chunk decoder so we can receive new images
            // when they come in
            fChunkDecoder = new GraphPortChunkDecoder(fBackingBuffer, fSketchChannel);
            fChunkDecoder.PixBltPixelBuffer24Handler += this.PixBltPixelBuffer24;
            fChunkDecoder.PixBltLumbHandler += this.PixBltLum24;
        }
Example #3
0
        void CreateSession()
        {
            IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("234.5.7.26"), 9060);
            fSession = new MultiSession(UniqueSessionName, ipep);

            AddChannels();
        }
Example #4
0
        public Form1()
        {
            InitializeComponent();

            // Create the session
            IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("234.5.7.26"), 9060);

            fSession = new MultiSession(Guid.NewGuid().ToString(), ipep);

            fViewer = new SketchView(fSession, 1600, 1200);
            fViewer.DataChangedEvent += new SketchView.DataChangedEventHandler(DataChanged);
        }
Example #5
0
        public Form1()
            :base("Camera Server", 10, 10, 320, 240)
        {
            string groupIP = "234.5.7.15";
            int groupPort = 5004;
            IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(groupIP), groupPort);

            fSession = new MultiSession(Guid.NewGuid().ToString(), ipep);
            fChannel = fSession.CreateChannel(PayloadType.xApplication3);

            fCameraSender = new VideoSender(0, fChannel);
            fCameraSender.Start();
        }
Example #6
0
        public SnapperWindow(int x, int y, int width, int height)
            : base("Snap N Share", 10, 10, 640, 480)
        {
            // Show a form so we can capture the desired group IP and port number
            ServerForm groupForm = new ServerForm();
            //IPAddress randomAddress = NewTOAPIA.Net.Utility.GetRandomMulticastAddress();
            //groupForm.groupAddressField.Text = randomAddress.ToString();
            groupForm.ShowDialog();

            // Get the address and port from the form
            fUseGray = groupForm.checkBox1.Checked;
            string groupIP = groupForm.groupAddressField.Text;
            int groupPort = int.Parse(groupForm.groupPortField.Text);
            IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(groupIP), groupPort);

            // Set our title to the address specified so the user
            // can easily identify their session.
            Title = "SnapNShare - " + ipep.ToString();
            
            fSnapper = new ScreenSnapper();

            fClientOrigin = new POINT();
            int pwidth = ClientRectangle.Width;
            int pheight = ClientRectangle.Height;
            fScreenImage = new GDIDIBSection(width, height, BitCount.Bits24);
            fGrayImage = new PixelArray<Lumb>(width, height,fScreenImage.Orientation, new Lumb());

            BackgroundColor = RGBColor.White;
            this.Opacity = 0.5;

            // Create the MultiSession object so we can send stuff out to a group
            //fSession = new MultiSession(Guid.NewGuid().ToString(), ipep);
            fSession = new MultiSession(ipep, Guid.NewGuid().ToString(), "William", true, true, null);

            // Add the channel for graphics commands
            PayloadChannel payloadChannel = fSession.CreateChannel(PayloadType.dynamicPresentation);
            fCommandDispatcher = new GraphPortChunkEncoder(payloadChannel);

            fUserIOChannel = fSession.CreateChannel(PayloadType.xApplication2);
            //fUserIOEncoder = new UserIOChannelEncoder(fUserIOChannel);
            //fUserIODecoder = new UserIOChannelDecoder(fUserIOChannel);
            //fUserIODecoder.MouseActivityEvent += new MouseActivityEventHandler(fUserIODecoder_MouseActivityEvent);
            //fUserIODecoder.KeyboardActivityEvent += new KeyboardActivityEventHandler(fUserIODecoder_KeyboardActivityEvent);

            // Start the thread that will take snapshots of the screen
            fGlobalTimer = new PrecisionTimer();
            fFrameRate = 2; // Frames per second
            fSnapperRunning = true;
            snapperThread = new Thread(RunSnaps);
            snapperThread.Start();
        }
Example #7
0
        public Form1()
        {
            InitializeComponent();


            // Setup the audio processing stuff
            fSpeakers = new WaveSpeaker();

            
            IPAddress address = IPAddress.Parse("239.5.7.15");
            IPEndPoint ep = new IPEndPoint(address, 5004);
            fSession = new MultiSession(ep, Guid.NewGuid().ToString(), Environment.UserName, true, true, null);
            
            fAudioChannel = fSession.CreateChannel(PayloadType.dynamicAudio);
            fAudioChannel.FrameReceivedEvent += new RtpStream.FrameReceivedEventHandler(ReceivedAudioEvent);
        }
Example #8
0
        DesktopSnapper fSnapper;    // The object that managers the snapshots

        public DDHostTrayApp()
        {
            // Create a simple tray menu with only one item.   
            trayMenu = new ContextMenu();

            menu_Settings=new MenuItem("Settings", OnSettingsSelect);
            menu_Sharing = new MenuItem("Sharing", OnChangeSharing);
            menu_RemoteControl = new MenuItem("Remote Control", OnRemoteControl);
            menu_Gray = new MenuItem("Gray", OnChangeGray);
            menu_Exit = new MenuItem("Exit", OnExit);

            trayMenu.MenuItems.Add(menu_Settings);
            trayMenu.MenuItems.Add(menu_RemoteControl);
            trayMenu.MenuItems.Add(menu_Sharing);
            trayMenu.MenuItems.Add(menu_Gray);
            trayMenu.MenuItems.Add(new MenuItem("-"));
            trayMenu.MenuItems.Add(menu_Exit);
            
            // Create a tray icon. In this example we use a   
            // standard system icon for simplicity, but you   
            // can of course use your own custom icon too.   
            trayIcon = new NotifyIcon();
            trayIcon.Text = "DD Host";
            trayIcon.Icon = new Icon("computer.ico");

            // Add menu to tray icon and show it.   
            trayIcon.ContextMenu = trayMenu;
            trayIcon.Visible = true;
            trayIcon.MouseDown += new System.Windows.Forms.MouseEventHandler(DDHostTrayApp_MouseDown);

            trayIcon.ShowBalloonTip(0, "DD Host", "Right Click for Settings", ToolTipIcon.Info);
            trayIcon.BalloonTipShown += new EventHandler(trayIcon_BalloonTipShown);

            // Create the communications sessions
            fGroupEndPoint = new IPEndPoint(IPAddress.Parse("234.5.7.15"), 5004);
            fSession = new MultiSession(Guid.NewGuid().ToString(), fGroupEndPoint);

            fGraphicsChannel = fSession.CreateChannel(PayloadType.dynamicPresentation);
            fUserIOChannel = fSession.CreateChannel(PayloadType.xApplication2);

            
            fSnapper = new DesktopSnapper(fGraphicsChannel, fUserIOChannel, true);

            menu_Gray.Checked = fSnapper.SendLuminance;
            menu_RemoteControl.Checked = fSnapper.AllowRemoteControl;
            menu_Sharing.Checked = fSnapper.ActivelySharing;
        }
Example #9
0
        //Bitmap fPreviewBitmap;
        //GDIRenderer fRenderer;
        //GDIContext fRendererContext;

        public MainForm()
        {
            InitializeComponent();

            fSetupControl = new CaptureDeviceSetupPage();
            //this.Controls.Add(fSetupControl);
            splitContainer1.Panel1.Controls.Add(fSetupControl);

            string groupIP = "234.5.7.15";
            int groupPort = 5004;
            IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(groupIP), groupPort);

            fSession = new MultiSession(Guid.NewGuid().ToString(), ipep);
            fChannel = fSession.CreateChannel(PayloadType.dynamicPresentation);

            fCameraSender = new VideoSender(0, fChannel);
            //fPreviewBitmap = new Bitmap(fCameraSender.Width, fCameraSender.Height, 
            fCameraSender.ReceivedVideoFrameEvent += new VideoSender.ReceivedVideoFrameHandler(fCameraSender_ReceivedVideoFrameEvent);
            fCameraSender.Start();
        }
Example #10
0
        public SketchView(MultiSession session, int width, int height)
        {
            fSession = session;

            // Create the backing buffer to retain the image
            backingBuffer = GDIDIBSection.Create(width, height);
            GDIContext bufferContext = GDIContext.CreateForBitmap(backingBuffer);

            bufferContext.ClearToWhite();
            fBackingGraphPort = new GDIRenderer(bufferContext);
            //fBackingGraphPort.ClearToWhite();

            // Add the channel for graphics commands
            fSketchChannel = fSession.CreateChannel(PayloadType.Whiteboard);

            fChunkDecoder = new GraphPortChunkDecoder();
            fChunkDecoder.AddGraphPort(fBackingGraphPort);

            fSketchChannel.FrameReceivedEvent += new RtpStream.FrameReceivedEventHandler(GDICommandReceived);
        }
Example #11
0
        public Form1()
        {
            InitializeComponent();

            IPAddress address = IPAddress.Parse("239.5.7.15");
            IPEndPoint ep = new IPEndPoint(address, 5010);
            fSession = new MultiSession(ep, Guid.NewGuid().ToString(), Environment.UserName, true, true, null);
            fAudioChannel = fSession.CreateChannel(PayloadType.dynamicAudio);

            fMicrophone = new WaveMicrophone(1, 11025, 8, 1.0 / 10.0);
            fSpeakers = new WaveSpeaker(1, 11025, 8, 1.0/10.0) ;

            // Startup a thread to process the audio as it comes in
            stopProcessing = false;
            processingStopped = new AutoResetEvent(false);

            audioProcessor = new Thread(ProcessAudio);
            audioProcessor.IsBackground = true;
            audioProcessor.Start();
        }
Example #12
0
        public Projector()
            : base("Snap N Projector", 20, 20, 640, 480)
        {
            HostForm groupForm = new HostForm();
            groupForm.ShowDialog();

            // Get the address and port from the form
            string groupIP = groupForm.groupAddressField.Text;
            int groupPort = int.Parse(groupForm.groupPortField.Text);
            IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(groupIP), groupPort);

            
            fDrawingContext = GDIContext.CreateForDesktopBackground();
            fDestinationRect = new Rectangle(0, 0, fDrawingContext.SizeInPixels.Width, fDrawingContext.SizeInPixels.Height);

            // Create the session
            fSession = new MultiSession(Guid.NewGuid().ToString(), ipep);

            fViewer = new SketchViewer(fSession, 1600, 1200);
            fViewer.DataChangedEvent += ReceiveImage;
        }