12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Threading;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Net;
- using bbiwarg.Graphics;
- using bbiwarg.InputProviders;
- using bbiwarg.Server;
- namespace bbiwarg
- {
- class MainBBIWARG
- {
- static void Main(string[] args)
- {
- if (args.Length > 0)
- {
- handleArgs(args);
- }
- Console.SetWindowSize(Constants.ConsoleWidth, Constants.ConsoleHeight);
-
- InputProvider inputProvider;
- if (Constants.InputSource == InputType.Movie)
- inputProvider = new VideoInputProvider(Constants.InputMoviePath);
- else
- inputProvider = new InputProvider();
- inputProvider.start();
- InputHandler inputHandler = new InputHandler(inputProvider);
- OutputWindow outputWindow = new OutputWindow(inputProvider, inputHandler);
- outputWindow.Run(Constants.OutputUpdateRate, Constants.OutputRenderRate);
- inputProvider.stop();
- }
- private static void handleArgs(String[] args)
- {
- String ipString = null;
- String portString = null;
- if (args.Length == 2)
- {
- ipString = args[0];
- portString = args[1];
- }
- else if (args.Length == 1)
- {
- String[] parts = args[0].Split(':');
- ipString = parts[0];
- if(parts.Length == 2)
- portString = parts[1];
- }
- while (!TuioCommunicator.tryParseIPAddress(ipString, out Constants.TuioIP))
- {
- Console.WriteLine("Please insert the TUIO-Client's IP (Default is 127.0.0.1):");
- ipString = Console.ReadLine();
- }
- Console.WriteLine("TUIO-IP is set to:" + Constants.TuioIP.ToString());
- while (!TuioCommunicator.tryParsePort(portString, out Constants.TuioPort))
- {
- Console.WriteLine("Please insert the TUIO-Client's Port (Default is 3333):");
- portString = Console.ReadLine();
- }
- Console.WriteLine("TUIO-PORT is set to:" + Constants.TuioPort);
- Constants.TuioEnabled = true;
- }
- }
- }
|