mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-06 07:53:47 +00:00
54 lines
1.3 KiB
C#
54 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using Xamarin.Forms;
|
|
|
|
namespace qController
|
|
{
|
|
public class QController
|
|
{
|
|
|
|
QUpdater qUpdater;
|
|
QCue selectedCue;
|
|
public QClient qClient;
|
|
QWorkSpace qWorkspace;
|
|
public QController(string address, int port)
|
|
{
|
|
qClient = new QClient(address, port);
|
|
|
|
qUpdater = new QUpdater(this);
|
|
qUpdater.Start();
|
|
|
|
qClient.qParser.SelectedCueUpdated += this.OnSelectedCueUpdated;
|
|
qClient.qParser.WorkspaceUpdated += this.OnWorkspaceUpdated;
|
|
|
|
|
|
|
|
}
|
|
|
|
public void sendCommand(string cmd){
|
|
qClient.sendString(cmd);
|
|
}
|
|
|
|
public void updateCueValue(QCue cue, string property, object newValue){
|
|
// qSender.sendArgs("/cue_id/"+cue.uniqueID+"/"+property, newValue);
|
|
}
|
|
|
|
public void OnSelectedCueUpdated(object source, CueEventArgs args)
|
|
{
|
|
selectedCue = args.SelectedCue;
|
|
//Console.WriteLine("Selected Cue Updated: Name=" + selectedCue.listName);
|
|
}
|
|
|
|
public void OnWorkspaceUpdated(object source, WorkspaceEventArgs args)
|
|
{
|
|
|
|
qWorkspace = args.UpdatedWorkspace;
|
|
|
|
}
|
|
public void Kill(){
|
|
qUpdater.Kill();
|
|
}
|
|
}
|
|
}
|