mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-05 15:33:47 +00:00
e97f9a7382
* qfont.ttf: * QIcon.cs: Add LIST and LEFT_DIR icons * Info.plist: * AndroidManifest.xml: Update Version Numbers * App.xaml.cs: * QCue.cs: * MenuPage.xaml.cs: * QCueList.cs: * ControlPage.xaml.cs: * QWorkSpace.cs: * QCueListCell.cs: * qConnectionPage.xaml.cs: * QParser.cs: * QUpdater.cs: * QController.cs: Android v1.0.8 / iOS v2.0.8
73 lines
2.2 KiB
C#
73 lines
2.2 KiB
C#
//Class used for overall Workspace control (ONLY REPRESENTS ONE WORKSPACE)
|
|
//Contains all necessary items to facilitate communication (sending, receiving) to a QLab workspace
|
|
//Also contains the local QWorkspace object which stores all the information that is used in displaying
|
|
//STILL NEED TO WORK ON PASSWORD PROTECTED WORKSPACES
|
|
using System;
|
|
using System.Diagnostics;
|
|
|
|
namespace qController
|
|
{
|
|
public class QController
|
|
{
|
|
|
|
public QUpdater qUpdater;
|
|
public QClient qClient;
|
|
public QWorkspace qWorkspace;
|
|
public string playbackPosition;
|
|
private string ipAddress;
|
|
private int port;
|
|
|
|
public QController(string address, int port)
|
|
{
|
|
this.port = port;
|
|
this.ipAddress = address;
|
|
|
|
qClient = new QClient(ipAddress, port);
|
|
qUpdater = new QUpdater(this);
|
|
|
|
}
|
|
|
|
public void Connect(string workspace_id)
|
|
{
|
|
Console.WriteLine("QCONTROLLER CONNECT CALLED: " + workspace_id);
|
|
qWorkspace = new QWorkspace(workspace_id);
|
|
qUpdater.Start();
|
|
qClient.sendArgsUDP("/workspace/"+workspace_id+"/connect");
|
|
qClient.sendArgsUDP("/workspace/"+workspace_id+"/updates", 1);
|
|
qClient.sendAndReceiveString("/workspace/"+workspace_id+"/cueLists");
|
|
}
|
|
|
|
public void KickOff()
|
|
{
|
|
qClient.sendArgsUDP("/workspaces");
|
|
}
|
|
|
|
public void Disconnect()
|
|
{
|
|
qClient.sendStringUDP("/workspace/"+qWorkspace.workspace_id+"/disconnect");
|
|
}
|
|
|
|
public void ConnectWithPass(string pass)
|
|
{
|
|
qClient.sendArgsUDP("/workspace/" + qWorkspace.workspace_id + "/connect", pass);
|
|
}
|
|
|
|
public void Resume()
|
|
{
|
|
//qClient = new QClient(ipAddress, port);
|
|
//qUpdater = new QUpdater(this);
|
|
if(qWorkspace != null)
|
|
{
|
|
Console.WriteLine("RESUMING " + qWorkspace.workspace_id);
|
|
}
|
|
}
|
|
|
|
public void Kill(){
|
|
if (qUpdater != null)
|
|
qUpdater.Kill();
|
|
if (qClient != null)
|
|
qClient.Close();
|
|
}
|
|
}
|
|
}
|