mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-13 03:13:53 +00:00
Work on multiple workspaces/password protected workspaces
This commit is contained in:
@@ -105,7 +105,6 @@ namespace qController
|
||||
|
||||
void Connect(object sender, EventArgs e)
|
||||
{
|
||||
App.rootPage.MenuPage.ChangeToControl();
|
||||
App.NavigationPage.Navigation.PushAsync(new ControlPage(nameLabel.Text,addressLabel.Text));
|
||||
|
||||
Console.WriteLine("Connect To " + nameLabel.Text + " Pressed");
|
||||
|
||||
@@ -7,37 +7,17 @@ namespace qController
|
||||
{
|
||||
public class QSelectedCueOptionsCell : Frame
|
||||
{
|
||||
void OnCueInfoUpdated(object source, CueEventArgs args)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() => {
|
||||
activeCue = args.Cue.uniqueID;
|
||||
if(args.Cue.levels != null)
|
||||
{
|
||||
levels = args.Cue.levels[0];
|
||||
if (mainSlider != null)
|
||||
{
|
||||
mainSlider.Value = levels[0];
|
||||
}
|
||||
if (leftSlider != null)
|
||||
{
|
||||
leftSlider.Value = levels[1];
|
||||
}
|
||||
if (rightSlider != null)
|
||||
{
|
||||
rightSlider.Value = levels[2];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
List<double> levels;
|
||||
string activeCue;
|
||||
Slider mainSlider;
|
||||
Slider leftSlider;
|
||||
Slider rightSlider;
|
||||
public QSelectedCueOptionsCell(QController qController)
|
||||
public List<double> levels;
|
||||
public string activeCue;
|
||||
public Slider mainSlider;
|
||||
public Slider leftSlider;
|
||||
public Slider rightSlider;
|
||||
public Label mainLabel;
|
||||
public Label rightLabel;
|
||||
public Label leftLabel;
|
||||
public QSelectedCueOptionsCell()
|
||||
{
|
||||
qController.qClient.qParser.CueInfoUpdated += OnCueInfoUpdated;
|
||||
Padding = new Thickness(5);
|
||||
CornerRadius = 20;
|
||||
BackgroundColor = Color.FromHex("D8D8D8");
|
||||
@@ -63,30 +43,21 @@ namespace qController
|
||||
Minimum = -60,
|
||||
Maximum = 12
|
||||
};
|
||||
mainSlider.ValueChanged += (sender, args) =>
|
||||
{
|
||||
qController.qClient.sendArgs("/cue_id/" + activeCue + "/sliderLevel/0", (float)args.NewValue);
|
||||
};
|
||||
|
||||
|
||||
leftSlider = new Slider
|
||||
{
|
||||
Minimum = -60,
|
||||
Maximum = 12
|
||||
};
|
||||
leftSlider.ValueChanged += (sender, args) =>
|
||||
{
|
||||
qController.qClient.sendArgs("/cue_id/" + activeCue + "/sliderLevel/1", (float)args.NewValue);
|
||||
};
|
||||
|
||||
|
||||
rightSlider = new Slider
|
||||
{
|
||||
Minimum = -60,
|
||||
Maximum = 12
|
||||
};
|
||||
rightSlider.ValueChanged += (sender, args) =>
|
||||
{
|
||||
qController.qClient.sendArgs("/cue_id/" + activeCue + "/sliderLevel/2", (float)args.NewValue);
|
||||
};
|
||||
|
||||
mainG.Children.Add(mainSlider, 1, 0);
|
||||
mainG.Children.Add(leftSlider, 1, 1);
|
||||
mainG.Children.Add(rightSlider, 1, 2);
|
||||
@@ -94,21 +65,20 @@ namespace qController
|
||||
Grid.SetColumnSpan(mainSlider, 4);
|
||||
Grid.SetColumnSpan(leftSlider, 4);
|
||||
Grid.SetColumnSpan(rightSlider, 4);
|
||||
|
||||
Label mainLabel = new Label {
|
||||
mainLabel = new Label {
|
||||
Text = "MAIN:",
|
||||
VerticalTextAlignment = TextAlignment.Center,
|
||||
HorizontalTextAlignment = TextAlignment.Center
|
||||
};
|
||||
|
||||
Label leftLabel = new Label
|
||||
leftLabel = new Label
|
||||
{
|
||||
Text = "LEFT:",
|
||||
VerticalTextAlignment = TextAlignment.Center,
|
||||
HorizontalTextAlignment = TextAlignment.Center
|
||||
};
|
||||
|
||||
Label rightLabel = new Label
|
||||
rightLabel = new Label
|
||||
{
|
||||
Text = "RIGHT:",
|
||||
VerticalTextAlignment = TextAlignment.Center,
|
||||
@@ -122,5 +92,22 @@ namespace qController
|
||||
Content = mainG;
|
||||
Margin = new Thickness(10);
|
||||
}
|
||||
|
||||
public void UpdateLevels(List<double> lin_levels)
|
||||
{
|
||||
levels = lin_levels;
|
||||
if (mainSlider != null)
|
||||
{
|
||||
mainSlider.Value = levels[0];
|
||||
}
|
||||
if (leftSlider != null)
|
||||
{
|
||||
leftSlider.Value = levels[1];
|
||||
}
|
||||
if (rightSlider != null)
|
||||
{
|
||||
rightSlider.Value = levels[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,17 +125,18 @@ namespace qController
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateSpecificCue(string cue_id)
|
||||
public void UpdateSpecificCue(string workspace_id,string cue_id)
|
||||
{
|
||||
string valuesForKeys = "[\"number\",\"uniqueID\",\"flagged\",\"listName\",\"type\",\"colorName\",\"name\",\"armed\",\"displayName\",\"isBroken\",\"isLoaded\",\"isPaused\",\"isRunning\",\"preWait\",\"duration\",\"postWait\",\"translationX\",\"translationY\",\"opacity\",\"scaleX\",\"scaleY\",\"notes\",\"levels\"]";
|
||||
string address = "/cue_id/" + cue_id + "/valuesForKeys";
|
||||
string address = "/workspace/" + workspace_id + "/cue_id/" + cue_id + "/valuesForKeys";
|
||||
sendAndReceiveStringArgs(address, valuesForKeys);
|
||||
}
|
||||
|
||||
public void UpdateSelectedCue()
|
||||
public void UpdateSelectedCue(string workspace_id)
|
||||
{
|
||||
string valuesForKeys = "[\"number\",\"uniqueID\",\"flagged\",\"listName\",\"type\",\"colorName\",\"name\",\"armed\",\"displayName\",\"isBroken\",\"isLoaded\",\"isPaused\",\"isRunning\",\"preWait\",\"duration\",\"postWait\",\"translationX\",\"translationY\",\"opacity\",\"scaleX\",\"scaleY\",\"notes\",\"levels\"]";
|
||||
sendAndReceiveStringArgs("/cue/selected/valuesForKeys", valuesForKeys);
|
||||
string valuesForKeys = "[\"number\",\"uniqueID\",\"flagged\",\"listName\",\"type\",\"colorName\",\"name\",\"armed\",\"displayName\",\"isBroken\",\"isLoaded\",\"isPaused\",\"isRunning\",\"preWait\",\"duration\",\"postWait\",\"translationX\",\"translationY\",\"opacity\",\"scaleX\",\"scaleY\",\"notes\",\"levels\"]";
|
||||
string address = "/workspace/" + workspace_id + "/cue/selected/valuesForKeys";
|
||||
sendAndReceiveStringArgs(address, valuesForKeys);
|
||||
}
|
||||
|
||||
public void UpdateWorkspace(string ws_id)
|
||||
|
||||
@@ -20,18 +20,19 @@ namespace qController
|
||||
qUpdater = new QUpdater(this);
|
||||
qUpdater.Start();
|
||||
//Connect();
|
||||
|
||||
Connect();
|
||||
KickOff();
|
||||
//Connect();
|
||||
//KickOff();
|
||||
|
||||
}
|
||||
|
||||
public void Connect()
|
||||
public void Connect(string workspace_id)
|
||||
{
|
||||
Console.WriteLine("QCONTROLLER CONNECT CALLED");
|
||||
Console.WriteLine("QCONTROLLER CONNECT CALLED: " + workspace_id);
|
||||
qWorkspace = new QWorkSpace();
|
||||
qWorkspace.workspace_id = workspace_id;
|
||||
//qClient.sendStringUDP("/connect");
|
||||
qClient.sendArgsUDP("/updates", 1);
|
||||
qClient.sendAndReceiveString("/cueLists");
|
||||
qClient.sendArgsUDP("/workspace/"+workspace_id+"/updates", 1);
|
||||
qClient.sendAndReceiveString("/workspace/"+workspace_id+"/cueLists");
|
||||
}
|
||||
|
||||
public void KickOff()
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace qController
|
||||
}
|
||||
else
|
||||
{
|
||||
qController.qClient.UpdateSelectedCue();
|
||||
qController.qClient.UpdateSelectedCue(qController.qWorkspace.workspace_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace qController
|
||||
{
|
||||
Console.WriteLine("Workspace group cues are already populated");
|
||||
App.showToast("Workspace cues have been loaded....");
|
||||
qController.qClient.UpdateSelectedCue();
|
||||
qController.qClient.UpdateSelectedCue(qController.qWorkspace.workspace_id);
|
||||
return;
|
||||
}
|
||||
//RefreshGroupCues();
|
||||
@@ -82,7 +82,7 @@ namespace qController
|
||||
public void OnPlaybackPositionUpdated(object source, PlaybackPositionArgs args)
|
||||
{
|
||||
qController.playbackPosition = args.PlaybackPosition;
|
||||
qController.qClient.UpdateSpecificCue(args.PlaybackPosition);
|
||||
qController.qClient.UpdateSpecificCue(qController.qWorkspace.workspace_id,args.PlaybackPosition);
|
||||
}
|
||||
|
||||
public void RefreshGroupCues()
|
||||
@@ -95,7 +95,7 @@ namespace qController
|
||||
if (cue.type == "Group")
|
||||
{
|
||||
Console.WriteLine("First Group Cue Found");
|
||||
qController.qClient.sendStringUDP("/cue_id/" + cue.uniqueID + "/children");
|
||||
qController.qClient.sendStringUDP("/workspace/" + qController.qWorkspace.workspace_id + "/cue_id/" + cue.uniqueID + "/children");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ namespace qController
|
||||
|
||||
public void SendThump()
|
||||
{
|
||||
qController.qClient.sendStringUDP("/thump");
|
||||
qController.qClient.sendStringUDP("/workspace/" + qController.qWorkspace.workspace_id + "/thump");
|
||||
}
|
||||
|
||||
public void Kill(){
|
||||
|
||||
Reference in New Issue
Block a user