|
@@ -15,24 +15,79 @@ using bbiwarg.TUIO;
|
|
|
|
|
|
namespace bbiwarg
|
|
|
{
|
|
|
+ /// <summary>
|
|
|
+ /// Main class which creates and starts the input, tuio and window objects.
|
|
|
+ /// </summary>
|
|
|
class BBIWARG
|
|
|
{
|
|
|
+ /// <summary>
|
|
|
+ /// the input provider
|
|
|
+ /// </summary>
|
|
|
private InputProvider inputProvider;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// the input handler
|
|
|
+ /// </summary>
|
|
|
private InputHandler inputHandler;
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// true iff the tuio server is enabled
|
|
|
+ /// </summary>
|
|
|
private bool tuioEnabled;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// the ip address for the tuio server
|
|
|
+ /// </summary>
|
|
|
private String tuioIP;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// the port for the tuio server
|
|
|
+ /// </summary>
|
|
|
private Int16 tuioPort;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// the tuio communicator
|
|
|
+ /// </summary>
|
|
|
private TuioCommunicator tuioCommunicator;
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// true iff the debug window is enabled
|
|
|
+ /// </summary>
|
|
|
private bool debugWindowEnabled;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// the debug window
|
|
|
+ /// </summary>
|
|
|
private DebugWindow debugWindow;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// the thread the debug window runs in
|
|
|
+ /// </summary>
|
|
|
private Thread debugWindowThread;
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// true iff the glasses window is enabled
|
|
|
+ /// </summary>
|
|
|
private bool glassesWindowEnabled;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// the thread the glasses window runs in
|
|
|
+ /// </summary>
|
|
|
private Thread glassesWindowThread;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// the glasses window
|
|
|
+ /// </summary>
|
|
|
private GlassesWindow glassesWindow;
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Starts the program.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="args"></param>
|
|
|
static void Main(string[] args)
|
|
|
{
|
|
|
Console.SetWindowSize(Parameters.ConsoleWidth, Parameters.ConsoleHeight);
|
|
@@ -41,6 +96,10 @@ namespace bbiwarg
|
|
|
program.run();
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Parses the command line arguments and depending on them creates the input, tuio and window objects.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="args">command line arguments</param>
|
|
|
public BBIWARG(string[] args)
|
|
|
{
|
|
|
handleArgs(args);
|
|
@@ -73,11 +132,17 @@ namespace bbiwarg
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Runs the main program.
|
|
|
+ /// </summary>
|
|
|
public void run()
|
|
|
{
|
|
|
inputProvider.start();
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Creates the input provider.
|
|
|
+ /// </summary>
|
|
|
private void createInputProvider()
|
|
|
{
|
|
|
if (Parameters.InputSource == InputType.Movie)
|
|
@@ -86,18 +151,29 @@ namespace bbiwarg
|
|
|
inputProvider = new InputProvider();
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Runs the debug window in its own thread.
|
|
|
+ /// </summary>
|
|
|
private void debugWindowThreadStart()
|
|
|
{
|
|
|
debugWindow = new DebugWindow(inputProvider, inputHandler, Parameters.DebugWindowTitle, Parameters.DebugWindowUpdateIntervall);
|
|
|
Application.Run(debugWindow);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Runs the glasses window in its own thread.
|
|
|
+ /// </summary>
|
|
|
private void glassesWindowThreadStart()
|
|
|
{
|
|
|
glassesWindow = new GlassesWindow(inputProvider, inputHandler, Parameters.GlassesWindowTitle, Screen.AllScreens[1], Parameters.GlassesWindowUpdateInterval);
|
|
|
Application.Run(glassesWindow);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Handles the event that the device has started by starting the enabled windows.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="sender">event sender</param>
|
|
|
+ /// <param name="e">event arguments</param>
|
|
|
private void handleDeviceStartedEvent(object sender, EventArgs e)
|
|
|
{
|
|
|
if (debugWindowEnabled)
|
|
@@ -107,6 +183,10 @@ namespace bbiwarg
|
|
|
glassesWindowThread.Start();
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Parses the command line arguments and sets parameters depending on them.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="args">command line arguments</param>
|
|
|
private void handleArgs(String[] args)
|
|
|
{
|
|
|
if (args.Length > 0)
|