mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-19 06:04:12 +00:00
* IconConstants.cs: Relocate
* QWorkspaceInfo.cs: * QParser.cs: * WorkspacePrompt.cs: * QEventArgs.cs: Remove redundant QWorkspaceInfo class * QRecentWorkspaceInfo.cs: Add bundle info class for recent workspace info * ControlPage.xaml.cs: * QBrowserPage.xaml.cs: * QButton.cs: * qConnectionPage.xaml.cs: * QLevelsCell.cs: * QCueListCell.cs: * QInstanceCell.cs: * QControlsBlock.cs: * ShadowButton.cs: * QLevelsButton.cs: * QSelectedCueCell.cs: Move Cells classess under UI * AppDelegate.cs: * packages.config: * MainActivity.cs: * packages.config: * qController.iOS.csproj: * qController.Droid.csproj: * qController.csproj: Update dependencies * App.xaml.cs: Add AppAction code for recent workspace * QStorage.cs: Add recent workspace to persistent storage * QCueGrid.cs: Start on interactivity with cue list grid * QCueViewModel.cs: debug for children updated start on reactive QCueGrid * WorkspacePage.xaml.cs: Start handling a "no selected cue" state and recent workspace * QInstance.cs: * IPHelper.cs: move reachable check to IPHelper - TODO: implement
This commit is contained in:
@@ -49,7 +49,7 @@ namespace qController.Communication
|
||||
|
||||
public class WorkspaceInfoArgs : EventArgs
|
||||
{
|
||||
public List<QWorkspaceInfo> WorkspaceInfo
|
||||
public List<QControlKit.QWorkspaceInfo> WorkspaceInfo
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
||||
@@ -15,5 +15,21 @@ namespace qController.Communication
|
||||
IPAddress address;
|
||||
return IPAddress.TryParse(ipString, out address);
|
||||
}
|
||||
|
||||
public static bool IsReachable(string ipString)
|
||||
{
|
||||
/*try
|
||||
{
|
||||
IPAddress instanceIP = IPAddress.Parse(address);
|
||||
Ping p = new System.Net.NetworkInformation.Ping();
|
||||
PingReply reply = p.Send(instanceIP);
|
||||
return reply.Status == IPStatus.Success ? true : false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}*/
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace qController.Communication
|
||||
public void ParseQInfo(OscMessage msg)
|
||||
{
|
||||
JToken qInfo = OSC2JSON(msg);
|
||||
List<QWorkspaceInfo> qWorkspaceInfo = JsonConvert.DeserializeObject<List<QWorkspaceInfo>>(qInfo.ToString());
|
||||
List<QControlKit.QWorkspaceInfo> qWorkspaceInfo = JsonConvert.DeserializeObject<List<QControlKit.QWorkspaceInfo>>(qInfo.ToString());
|
||||
OnWorkspaceInfoReceived(qWorkspaceInfo);
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace qController.Communication
|
||||
{
|
||||
WorkspaceDisconnect?.Invoke(this, new EventArgs());
|
||||
}
|
||||
protected virtual void OnWorkspaceInfoReceived(List<QWorkspaceInfo> workspaces)
|
||||
protected virtual void OnWorkspaceInfoReceived(List<QControlKit.QWorkspaceInfo> workspaces)
|
||||
{
|
||||
WorkspaceInfoReceived?.Invoke(this, new WorkspaceInfoArgs() { WorkspaceInfo = workspaces });
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using Acr.UserDialogs;
|
||||
using qController.QItems;
|
||||
using Serilog;
|
||||
using QControlKit;
|
||||
|
||||
namespace qController.Dialogs
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,18 +17,7 @@ namespace qController.QItems
|
||||
}
|
||||
public bool IsReachable()
|
||||
{
|
||||
/*try
|
||||
{
|
||||
IPAddress instanceIP = IPAddress.Parse(address);
|
||||
Ping p = new System.Net.NetworkInformation.Ping();
|
||||
PingReply reply = p.Send(instanceIP);
|
||||
return reply.Status == IPStatus.Success ? true : false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}*/
|
||||
return true;
|
||||
return qController.Communication.IPHelper.IsReachable(address);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
//General information about a QLab Workspace
|
||||
namespace qController.QItems
|
||||
{
|
||||
public class QWorkspaceInfo
|
||||
{
|
||||
public string version { get; set; }
|
||||
public string displayName { get; set; }
|
||||
public string uniqueID { get; set; }
|
||||
public bool hasPasscode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using QControlKit;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class QRecentWorkspaceInfo
|
||||
{
|
||||
public QWorkspaceInfo workspaceInfo { get; set; }
|
||||
public QServerInfo serverInfo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,24 +2,33 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using Acr.Settings;
|
||||
using qController.QItems;
|
||||
using QControlKit;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class QStorage
|
||||
{
|
||||
public static ObservableCollection<QInstance> qInstances;
|
||||
public static QRecentWorkspaceInfo recentWorkspaceInfo;
|
||||
|
||||
static QStorage(){
|
||||
|
||||
qInstances = (ObservableCollection<QInstance>)CrossSettings.Current.GetValue(new ObservableCollection<QInstance>().GetType(), "qInstances", null);
|
||||
|
||||
recentWorkspaceInfo = (QRecentWorkspaceInfo)CrossSettings.Current.GetValue(typeof (QRecentWorkspaceInfo),"recentWorkspaceInfo",null);
|
||||
if (qInstances == null)
|
||||
{
|
||||
Log.Debug("QSTORAGE - No qInstance exists creating one");
|
||||
qInstances = new ObservableCollection<QInstance>();
|
||||
updateStorage();
|
||||
UpdateStorage();
|
||||
}
|
||||
}
|
||||
|
||||
public static void UpdateRecentWorkspace(QRecentWorkspaceInfo packagedInfo)
|
||||
{
|
||||
recentWorkspaceInfo = packagedInfo;
|
||||
CrossSettings.Current.SetValue("recentWorkspaceInfo", recentWorkspaceInfo);
|
||||
}
|
||||
|
||||
public static bool AddInstance(string name, string address){
|
||||
return AddInstance(new QInstance(name, address));
|
||||
}
|
||||
@@ -27,7 +36,7 @@ namespace qController
|
||||
public static bool AddInstance(QInstance q){
|
||||
if(!Contains(q.name, q.address)){
|
||||
qInstances.Add(q);
|
||||
updateStorage();
|
||||
UpdateStorage();
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
@@ -45,10 +54,10 @@ namespace qController
|
||||
}
|
||||
public static void RemoveInstance(QInstance q){
|
||||
qInstances.Remove(q);
|
||||
updateStorage();
|
||||
UpdateStorage();
|
||||
}
|
||||
|
||||
private static void updateStorage(){
|
||||
private static void UpdateStorage(){
|
||||
CrossSettings.Current.SetValue("qInstances", qInstances);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController.UI.Buttons
|
||||
{
|
||||
public class QButton : Button
|
||||
{
|
||||
public QCommand qCommand
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public QButton(QCommand command)
|
||||
{
|
||||
|
||||
qCommand = command;
|
||||
Text = qCommand.text;
|
||||
TextColor = Color.Black;
|
||||
FontSize = App.HeightUnit * 2.5;
|
||||
if (qCommand.osc.Contains("go"))
|
||||
{
|
||||
BackgroundColor = Color.SeaGreen;
|
||||
switch (Device.RuntimePlatform)
|
||||
{
|
||||
case Device.iOS:
|
||||
FontSize = App.HeightUnit * 4;
|
||||
FontAttributes = FontAttributes.Bold;
|
||||
break;
|
||||
case Device.Android:
|
||||
FontSize = App.HeightUnit * 4;
|
||||
FontAttributes = FontAttributes.Bold;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (qCommand.osc.Contains("panic"))
|
||||
{
|
||||
BackgroundColor = Color.IndianRed;
|
||||
}
|
||||
else
|
||||
{
|
||||
BackgroundColor = Color.FromHex("D8D8D8");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Xamarin.Forms;
|
||||
namespace qController.UI.Buttons
|
||||
{
|
||||
public class QLevelsButton : ShadowButton
|
||||
{
|
||||
public Button button;
|
||||
public QLevelsButton()
|
||||
{
|
||||
button = new Button
|
||||
{
|
||||
Text = QIcon.SLIDERS,
|
||||
TextColor = Color.Black,
|
||||
FontFamily = App.QFont,
|
||||
FontSize = App.HeightUnit * 4,
|
||||
VerticalOptions = LayoutOptions.FillAndExpand,
|
||||
HorizontalOptions = LayoutOptions.FillAndExpand,
|
||||
HeightRequest = App.HeightUnit * 8,
|
||||
WidthRequest = App.HeightUnit * 8,
|
||||
CornerRadius = (int)(App.HeightUnit * 4),
|
||||
BackgroundColor = Color.LightBlue
|
||||
};
|
||||
|
||||
HeightRequest = button.Height;
|
||||
WidthRequest = button.Width;
|
||||
CornerRadius = button.CornerRadius;
|
||||
Content = button;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController.UI.Buttons
|
||||
{
|
||||
public class ShadowButton : Frame
|
||||
{
|
||||
public ShadowButton(Button b)
|
||||
{
|
||||
//Content = b;
|
||||
HeightRequest = b.Height;
|
||||
WidthRequest = b.Width;
|
||||
CornerRadius = b.CornerRadius;
|
||||
Padding = new Thickness(0);
|
||||
Content = b;
|
||||
HasShadow = true;
|
||||
BorderColor = Color.Black;
|
||||
IsVisible = false;
|
||||
}
|
||||
|
||||
public ShadowButton()
|
||||
{
|
||||
HasShadow = true;
|
||||
BorderColor = Color.Black;
|
||||
IsVisible = false;
|
||||
Padding = new Thickness(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ namespace qController.UI
|
||||
};
|
||||
cueLabel.SetBinding(Label.TextProperty, "name", BindingMode.OneWay);
|
||||
cueLabel.SetDynamicResource(Label.TextColorProperty, "PrimaryTextColor");
|
||||
cueLabel.SetBinding(Label.PaddingProperty, "nestPadding", BindingMode.OneWay);
|
||||
cueLabel.SetBinding(Label.MarginProperty, "nestPadding", BindingMode.OneWay);
|
||||
|
||||
var cueTypeLabel = new Label
|
||||
{
|
||||
@@ -70,13 +70,18 @@ namespace qController.UI
|
||||
cueTypeLabel.SetBinding(Label.TextProperty, "type", BindingMode.OneWay);
|
||||
cueTypeLabel.SetDynamicResource(Label.TextColorProperty, "IconTextColor");
|
||||
|
||||
//Section for selecting a cue by tapping the name Label
|
||||
var selectCueGesture = new TapGestureRecognizer();
|
||||
selectCueGesture.Tapped += (sender, e) =>
|
||||
|
||||
if (!cue.IsCueList)
|
||||
{
|
||||
cue.workspace.firstCueList.playbackPositionID = cue.uid;
|
||||
};
|
||||
cueLabel.GestureRecognizers.Add(selectCueGesture);
|
||||
//Section for selecting a cue by tapping the name Label
|
||||
var selectCueGesture = new TapGestureRecognizer();
|
||||
selectCueGesture.Tapped += (sender, e) =>
|
||||
{
|
||||
//TODO: need to make this work regardless of the cue list a cue is in
|
||||
cue.workspace.firstCueList.playbackPositionID = cue.uid;
|
||||
};
|
||||
cueLabel.GestureRecognizers.Add(selectCueGesture);
|
||||
}
|
||||
|
||||
//Add collapse gesture to the cue type icon if it is a group cue
|
||||
if (cue.IsGroup)
|
||||
|
||||
Reference in New Issue
Block a user