mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-08 00:43:48 +00:00
Cleanup
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="monoandroid71" />
|
||||
<package id="NETStandard.Library" version="2.0.3" targetFramework="monoandroid81" />
|
||||
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="monoandroid81" />
|
||||
<package id="Splat" version="8.0.1" targetFramework="monoandroid81" />
|
||||
<package id="Splat" version="8.0.5" targetFramework="monoandroid81" />
|
||||
<package id="System.AppContext" version="4.3.0" targetFramework="monoandroid71" />
|
||||
<package id="System.Collections" version="4.3.0" targetFramework="monoandroid71" />
|
||||
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="monoandroid71" />
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<HintPath>..\packages\Acr.Settings.9.0.1\lib\monoandroid80\Acr.Settings.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Splat">
|
||||
<HintPath>..\packages\Splat.8.0.1\lib\monoandroid81\Splat.dll</HintPath>
|
||||
<HintPath>..\packages\Splat.8.0.5\lib\monoandroid81\Splat.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reactive">
|
||||
<HintPath>..\packages\System.Reactive.4.1.5\lib\netstandard2.0\System.Reactive.dll</HintPath>
|
||||
|
||||
Vendored
BIN
Binary file not shown.
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
@@ -11,7 +10,8 @@ namespace qController
|
||||
set;
|
||||
}
|
||||
|
||||
public QButton(QCommand command){
|
||||
public QButton(QCommand command)
|
||||
{
|
||||
qCommand = command;
|
||||
Text = qCommand.text;
|
||||
TextColor = Color.Black;
|
||||
|
||||
@@ -4,22 +4,20 @@ using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class QControlsBlock: Frame
|
||||
public class QControlsBlock : Frame
|
||||
{
|
||||
Grid mainG;
|
||||
QController qController;
|
||||
|
||||
|
||||
|
||||
public QControlsBlock(QController controller)
|
||||
{
|
||||
qController = controller;
|
||||
|
||||
|
||||
|
||||
Margin = new Thickness(10);
|
||||
Padding = new Thickness(0);
|
||||
IsVisible = true;
|
||||
|
||||
|
||||
|
||||
BackgroundColor = Color.Transparent;
|
||||
//highlight Button Grid
|
||||
@@ -34,10 +32,11 @@ namespace qController
|
||||
commands.Add(QCommands.RESUME);
|
||||
//setCustomButtons(commands);
|
||||
setDefaultButtons();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void setDefaultButtons(){
|
||||
void setDefaultButtons()
|
||||
{
|
||||
List<QButton> buttons = new List<QButton>();
|
||||
|
||||
buttons.Add(new QButton(QCommands.PREVIOUS));
|
||||
@@ -65,7 +64,7 @@ namespace qController
|
||||
|
||||
int row = 0;
|
||||
int column = 0;
|
||||
for(int i = 0; i < buttons.Count; i++)
|
||||
for (int i = 0; i < buttons.Count; i++)
|
||||
{
|
||||
QButton b = buttons[i];
|
||||
b.Clicked += sendOSC;
|
||||
@@ -85,7 +84,8 @@ namespace qController
|
||||
Content = mainG;
|
||||
}
|
||||
|
||||
public void setCustomButtons(List<QCommand> commands){
|
||||
public void setCustomButtons(List<QCommand> commands)
|
||||
{
|
||||
mainG = new Grid
|
||||
{
|
||||
Padding = new Thickness(0),
|
||||
@@ -104,7 +104,7 @@ namespace qController
|
||||
|
||||
int row = 0;
|
||||
int column = 0;
|
||||
for(int i = 0; i < commands.Count; i++)
|
||||
for (int i = 0; i < commands.Count; i++)
|
||||
{
|
||||
QButton b = new QButton(commands[i]);
|
||||
b.Clicked += sendOSC;
|
||||
@@ -126,10 +126,11 @@ namespace qController
|
||||
|
||||
void sendOSC(object sender, EventArgs e)
|
||||
{
|
||||
if(((QButton)sender).qCommand.type == "WORKSPACE"){
|
||||
if (((QButton)sender).qCommand.type == "WORKSPACE")
|
||||
{
|
||||
string workspace_prefix = "/workspace/" + qController.qWorkspace.workspace_id;
|
||||
string command = workspace_prefix + ((QButton)sender).qCommand.osc;
|
||||
qController.qClient.sendStringUDP(command);
|
||||
qController.qClient.sendStringUDP(command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,14 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using Xamarin.Forms;
|
||||
using SharpOSC;
|
||||
using System.Threading;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
|
||||
|
||||
public class QInstance : ViewCell
|
||||
{
|
||||
public string name { get; set; }
|
||||
public string address { get; set; }
|
||||
public QInstance()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
public QInstance(string tName, string tAddress)
|
||||
{
|
||||
@@ -38,5 +31,4 @@ namespace qController
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
//IP Address verification
|
||||
//IMPLEMENT A ISREACHABLE METHOD TO BE ABLE TO DISPLAY ONLINE QINSTANCES
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace qController
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
//Class used to facilitate communication with a QInstance
|
||||
//Listens for incoming messages via qReceiver (UDP) and tcpSender (TCP)
|
||||
//WEIRD MESSAGE PARSING RULES NEED FIXED
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using SharpOSC;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class QClient
|
||||
|
||||
@@ -3,10 +3,7 @@
|
||||
//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.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
@@ -15,7 +12,7 @@ namespace qController
|
||||
|
||||
public QUpdater qUpdater;
|
||||
public QClient qClient;
|
||||
public QWorkSpace qWorkspace;
|
||||
public QWorkspace qWorkspace;
|
||||
public string playbackPosition;
|
||||
public Stopwatch sw;
|
||||
public QController(string address, int port)
|
||||
@@ -23,19 +20,15 @@ namespace qController
|
||||
qClient = new QClient(address, port);
|
||||
qUpdater = new QUpdater(this);
|
||||
|
||||
//Connect();
|
||||
//Connect();
|
||||
//KickOff();
|
||||
|
||||
}
|
||||
|
||||
public void Connect(string workspace_id)
|
||||
{
|
||||
Console.WriteLine("QCONTROLLER CONNECT CALLED: " + workspace_id);
|
||||
qWorkspace = new QWorkSpace();
|
||||
qWorkspace = new QWorkspace();
|
||||
qWorkspace.workspace_id = workspace_id;
|
||||
qUpdater.Start();
|
||||
qClient.sendStringUDP("/connect");
|
||||
qClient.sendArgsUDP("/workspace/"+workspace_id+"/connect");
|
||||
qClient.sendArgsUDP("/workspace/"+workspace_id+"/updates", 1);
|
||||
qClient.sendAndReceiveString("/workspace/"+workspace_id+"/cueLists");
|
||||
}
|
||||
@@ -47,17 +40,19 @@ namespace qController
|
||||
|
||||
public void Disconnect()
|
||||
{
|
||||
qClient.sendStringUDP("/disconnect");
|
||||
qClient.sendStringUDP("/workspace/"+qWorkspace.workspace_id+"/disconnect");
|
||||
}
|
||||
|
||||
public void ConnectWithPass(string pass)
|
||||
{
|
||||
qClient.sendArgsUDP("/connect", pass);
|
||||
qClient.sendArgsUDP("/workspace/" + qWorkspace.workspace_id + "/connect", pass);
|
||||
}
|
||||
|
||||
public void Kill(){
|
||||
qUpdater.Kill();
|
||||
qClient.Close();
|
||||
if (qUpdater != null)
|
||||
qUpdater.Kill();
|
||||
if (qClient != null)
|
||||
qClient.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
//Currently unused would like to reimplement eventually
|
||||
//Currently being done in qConnectionPage.xaml.cs Scan() method
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Zeroconf;
|
||||
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class QFinder
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
using System;
|
||||
using System;
|
||||
using SharpOSC;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
@@ -18,7 +17,7 @@ namespace qController
|
||||
|
||||
public class WorkspaceEventArgs : EventArgs
|
||||
{
|
||||
public QWorkSpace UpdatedWorkspace
|
||||
public QWorkspace UpdatedWorkspace
|
||||
{
|
||||
get;
|
||||
set;
|
||||
@@ -45,7 +44,7 @@ namespace qController
|
||||
|
||||
public class WorkspaceInfoArgs : EventArgs
|
||||
{
|
||||
public List<QInfo> WorkspaceInfo
|
||||
public List<QWorkspaceInfo> WorkspaceInfo
|
||||
{
|
||||
get;
|
||||
set;
|
||||
@@ -155,7 +154,7 @@ namespace qController
|
||||
public void ParseQInfo(OscMessage msg)
|
||||
{
|
||||
JToken qInfo = OSC2JSON(msg);
|
||||
List<QInfo> qWorkspaceInfo = JsonConvert.DeserializeObject<List<QInfo>>(qInfo.ToString());
|
||||
List<QWorkspaceInfo> qWorkspaceInfo = JsonConvert.DeserializeObject<List<QWorkspaceInfo>>(qInfo.ToString());
|
||||
OnWorkspaceInfoReceived(qWorkspaceInfo);
|
||||
}
|
||||
|
||||
@@ -163,7 +162,7 @@ namespace qController
|
||||
{
|
||||
if (msg.Arguments.Count > 0)
|
||||
{
|
||||
QWorkSpace workspace = JsonConvert.DeserializeObject<QWorkSpace>(msg.Arguments[0].ToString());
|
||||
QWorkspace workspace = JsonConvert.DeserializeObject<QWorkspace>(msg.Arguments[0].ToString());
|
||||
OnWorkspaceUpdated(workspace);
|
||||
}
|
||||
}
|
||||
@@ -184,7 +183,7 @@ namespace qController
|
||||
return json.GetValue("data");
|
||||
}
|
||||
|
||||
protected virtual void OnWorkspaceUpdated(QWorkSpace workspace)
|
||||
protected virtual void OnWorkspaceUpdated(QWorkspace workspace)
|
||||
{
|
||||
if (WorkspaceUpdated != null)
|
||||
WorkspaceUpdated(this, new WorkspaceEventArgs() { UpdatedWorkspace = workspace });
|
||||
@@ -221,7 +220,7 @@ namespace qController
|
||||
if (WorkspaceDisconnect != null)
|
||||
WorkspaceDisconnect(this, new EventArgs());
|
||||
}
|
||||
protected virtual void OnWorkspaceInfoReceived(List<QInfo> workspaces)
|
||||
protected virtual void OnWorkspaceInfoReceived(List<QWorkspaceInfo> workspaces)
|
||||
{
|
||||
if (WorkspaceInfoReceived != null)
|
||||
WorkspaceInfoReceived(this, new WorkspaceInfoArgs() { WorkspaceInfo = workspaces });
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
//Class used for receiving workspace update messages
|
||||
|
||||
using System;
|
||||
using SharpOSC;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
|
||||
namespace qController
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//Class used for updating local "copy" of workspace info, cue-lists, cues, etc.
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using Xamarin.Forms;
|
||||
using SharpOSC;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class QUpdater
|
||||
@@ -43,7 +42,7 @@ namespace qController
|
||||
if (args.Cue.type == "Group")
|
||||
{
|
||||
//Console.WriteLine("QUpdater/Updated cue was group cue, sending children request");
|
||||
qController.qClient.sendStringUDP("/cue_id/" + args.Cue.uniqueID + "/children");
|
||||
qController.qClient.sendStringUDP("/workspace/"+qController.qWorkspace.workspace_id+"/cue_id/" + args.Cue.uniqueID + "/children");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class QCue
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
|
||||
@@ -5,13 +5,14 @@ using System.Collections.Generic;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class QWorkSpace
|
||||
public class QWorkspace
|
||||
{
|
||||
public string status { get; set; }
|
||||
public List<QCueList> data { get; set; }
|
||||
public string workspace_id { get; set; }
|
||||
public string address { get; set; }
|
||||
public bool IsPopulated { get; set; }
|
||||
|
||||
public QCue GetCue(string cue_id)
|
||||
{
|
||||
foreach (var cueList in data)
|
||||
@@ -61,23 +62,6 @@ namespace qController
|
||||
}
|
||||
}
|
||||
|
||||
public QCue GetEmptyGroup()
|
||||
{
|
||||
foreach (var cueList in data)
|
||||
{
|
||||
foreach (var cue in cueList.cues)
|
||||
{
|
||||
if (cue.type == "Group" && cue.cues == null)
|
||||
{
|
||||
Console.WriteLine("Next Group Cue Found");
|
||||
return cue;
|
||||
}
|
||||
}
|
||||
}
|
||||
IsPopulated = true;
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool CheckPopulated()
|
||||
{
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
//General information about a QLab Workspace
|
||||
using System;
|
||||
namespace qController
|
||||
{
|
||||
public class QInfo
|
||||
public class QWorkspaceInfo
|
||||
{
|
||||
public string version { get; set; }
|
||||
public string displayName { get; set; }
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class MenuPageItem
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
namespace qController
|
||||
namespace qController
|
||||
{
|
||||
public class QCommand
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
namespace qController
|
||||
namespace qController
|
||||
{
|
||||
public static class QCommands
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
namespace qController
|
||||
namespace qController
|
||||
{
|
||||
public static class QIcon
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using Acr.Settings;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class QStorage
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Acr.UserDialogs;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public partial class App : Application
|
||||
@@ -14,6 +15,7 @@ namespace qController
|
||||
public static double Width;
|
||||
public static double HeightUnit;
|
||||
public static double WidthUnit;
|
||||
|
||||
public static bool MenuIsPresented
|
||||
{
|
||||
get
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Threading;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
@@ -76,7 +74,7 @@ namespace qController
|
||||
});
|
||||
|
||||
}
|
||||
public void ChangeToWorkspace(QWorkSpace workspace)
|
||||
public void ChangeToWorkspace(QWorkspace workspace)
|
||||
{
|
||||
for(int i = 0; i < workspace.data.Count; i++)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label x:Name = "menuButton" FontFamily = "{StaticResource qfont}" HorizontalOptions = "Start" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="0" Text=""/>
|
||||
</Grid>
|
||||
<ListView x:Name="listView" HasUnevenRows="true" BackgroundColor="#4A4A4A"></ListView>
|
||||
<ListView x:Name="listView" HasUnevenRows="true" BackgroundColor="#4A4A4A" SeparatorVisibility="None"></ListView>
|
||||
|
||||
</StackLayout>
|
||||
</ContentPage>
|
||||
@@ -1,11 +1,8 @@
|
||||
using Xamarin.Forms;
|
||||
using System.Net;
|
||||
using System;
|
||||
using Acr.UserDialogs;
|
||||
using Acr.Settings;
|
||||
using Zeroconf;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
@@ -52,10 +49,10 @@ namespace qController
|
||||
private void InitGUI()
|
||||
{
|
||||
NavigationPage.SetHasNavigationBar(this, false);
|
||||
listView.ItemsSource = QStorage.qInstances;
|
||||
|
||||
//ListView Setup
|
||||
listView.ItemsSource = QStorage.qInstances;
|
||||
listView.ItemTemplate = new DataTemplate(typeof(QInstanceCell));
|
||||
listView.SeparatorVisibility = SeparatorVisibility.None;
|
||||
listView.ItemTapped += (object sender, ItemTappedEventArgs e) =>
|
||||
{
|
||||
// don't do anything if we just de-selected the row
|
||||
@@ -64,12 +61,11 @@ namespace qController
|
||||
((ListView)sender).SelectedItem = null; // de-select the row
|
||||
};
|
||||
|
||||
menuButton.Margin = new Thickness(App.WidthUnit * 2, 0, 0, App.WidthUnit * 2);
|
||||
|
||||
//Platform Specific Setup
|
||||
switch (Device.RuntimePlatform)
|
||||
{
|
||||
case Device.iOS:
|
||||
topBar.HeightRequest = Math.Max(App.Height * .09, 65);
|
||||
topBar.HeightRequest = App.Height * .09;
|
||||
menuButton.FontSize = App.Height * .04;
|
||||
break;
|
||||
case Device.Android:
|
||||
@@ -78,10 +74,13 @@ namespace qController
|
||||
break;
|
||||
}
|
||||
|
||||
BackgroundColor = Color.FromHex("4A4A4A");
|
||||
BackgroundColor = Color.FromHex("4A4A4A");
|
||||
|
||||
//MenuButton Setup
|
||||
var menuButtonGesture = new TapGestureRecognizer();
|
||||
menuButtonGesture.Tapped += showMenu;
|
||||
menuButton.GestureRecognizers.Add(menuButtonGesture);
|
||||
menuButton.Margin = new Thickness(App.WidthUnit * 2, 0, 0, App.WidthUnit * 2);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.1.0.581479" />
|
||||
<PackageReference Include="Acr.Settings" Version="9.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||
<PackageReference Include="Rssdp" Version="4.0.2" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.2.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user