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) { Console.SetWindowSize(Parameters.ConsoleWidth, Parameters.ConsoleHeight); if (args.Length > 0) { handleArgs(args); } InputProvider inputProvider; if (Parameters.InputSource == InputType.Movie) inputProvider = new VideoInputProvider(Parameters.InputMoviePath); else inputProvider = new InputProvider(); inputProvider.start(); InputHandler inputHandler = new InputHandler(inputProvider); OutputWindow outputWindow = new OutputWindow(inputProvider, inputHandler); outputWindow.Run(Parameters.OutputUpdateRate, Parameters.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 Parameters.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:" + Parameters.TuioIP.ToString()); while (!TuioCommunicator.tryParsePort(portString, out Parameters.TuioPort)) { Console.WriteLine("Please insert the TUIO-Client's Port (Default is 3333):"); portString = Console.ReadLine(); } Console.WriteLine("TUIO-PORT is set to:" + Parameters.TuioPort); Parameters.TuioEnabled = true; } } }