mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-17 05:13:40 +00:00
* qfont.ttf:
* qfont.ttf: Icons * App.xaml.cs: Set Font String System Wide * RootPage.xaml.cs: * QGrid.cs: * QCueListView.cs: * qConnectionPage.xaml.cs: * IPHelper.cs: * QInstanceCell.cs: Switch to using Icon Font * QSelectedCueCell.cs: Switch to Type Icon instead of just name * QClient.cs: Create and dispose of sender for every sent message * QCue.cs: Add Icon Code method * ControlPage.xaml: Add hamburger menu * ControlPage.xaml.cs: Menu for Workspace listing/ cue selection * MenuPage.xaml.cs: Function to change menu items back for home page
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class QCueListView : Frame
|
||||
{
|
||||
ListView listView;
|
||||
public QCueListView()
|
||||
{
|
||||
Padding = new Thickness(5);
|
||||
CornerRadius = 20;
|
||||
BackgroundColor = Color.FromHex("D8D8D8");
|
||||
Grid mainG = new Grid
|
||||
{
|
||||
Padding = new Thickness(0),
|
||||
RowDefinitions =
|
||||
{
|
||||
new RowDefinition{Height = GridLength.Star}
|
||||
},
|
||||
ColumnDefinitions =
|
||||
{
|
||||
new ColumnDefinition{Width = new GridLength(1,GridUnitType.Star)}
|
||||
}
|
||||
};
|
||||
listView = new ListView();
|
||||
mainG.Children.Add(listView, 0, 0);
|
||||
Margin = new Thickness(10);
|
||||
Content = mainG;
|
||||
}
|
||||
|
||||
public void UpdateWithWorkspace(QWorkSpace qWorkspace)
|
||||
{
|
||||
List<string> cueLists = new List<string>();
|
||||
foreach( var cueList in qWorkspace.data )
|
||||
{
|
||||
cueLists.Add(cueList.listName);
|
||||
foreach(var cue in cueList.cues)
|
||||
{
|
||||
if(cue.number == "")
|
||||
cueLists.Add("\t" + cue.listName);
|
||||
else
|
||||
cueLists.Add("\t" + cue.number + " - " + cue.listName);
|
||||
}
|
||||
}
|
||||
listView.ItemsSource = cueLists.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,6 @@ namespace qController
|
||||
|
||||
Label nameLabel = new Label();
|
||||
Label addressLabel = new Label();
|
||||
Image connectButton = new Image();
|
||||
Image deleteButton = new Image();
|
||||
|
||||
Label connectLabel = new Label();
|
||||
Label deleteLabel = new Label();
|
||||
@@ -21,12 +19,10 @@ namespace qController
|
||||
var deleteTapGesture = new TapGestureRecognizer();
|
||||
|
||||
connectTapGesture.Tapped += Connect;
|
||||
connectButton.GestureRecognizers.Add(connectTapGesture);
|
||||
connectLabel.GestureRecognizers.Add(connectTapGesture);
|
||||
|
||||
|
||||
deleteTapGesture.Tapped += Delete;
|
||||
deleteButton.GestureRecognizers.Add(deleteTapGesture);
|
||||
deleteLabel.GestureRecognizers.Add(deleteTapGesture);
|
||||
|
||||
InitItems();
|
||||
@@ -79,15 +75,6 @@ namespace qController
|
||||
nameLabel.FontAttributes = FontAttributes.Bold;
|
||||
nameLabel.FontSize = 20;
|
||||
|
||||
connectButton.HorizontalOptions = LayoutOptions.CenterAndExpand;
|
||||
connectButton.VerticalOptions = LayoutOptions.CenterAndExpand;
|
||||
connectButton.Source = "connect.png";
|
||||
|
||||
|
||||
deleteButton.HorizontalOptions = LayoutOptions.CenterAndExpand;
|
||||
deleteButton.VerticalOptions = LayoutOptions.CenterAndExpand;
|
||||
deleteButton.Source = "delete.png";
|
||||
|
||||
addressLabel.HorizontalTextAlignment = TextAlignment.Center;
|
||||
addressLabel.VerticalTextAlignment = TextAlignment.Start;
|
||||
|
||||
@@ -103,20 +90,8 @@ namespace qController
|
||||
deleteLabel.FontSize = 40;
|
||||
deleteLabel.TextColor = Color.Red;
|
||||
|
||||
string qfont = "";
|
||||
|
||||
switch (Device.RuntimePlatform)
|
||||
{
|
||||
case Device.iOS:
|
||||
qfont = "qfont";
|
||||
break;
|
||||
case Device.Android:
|
||||
qfont = "qfont.ttf#qfont";
|
||||
break;
|
||||
|
||||
}
|
||||
connectLabel.FontFamily = qfont;
|
||||
deleteLabel.FontFamily = qfont;
|
||||
connectLabel.FontFamily = App.QFont;
|
||||
deleteLabel.FontFamily = App.QFont;
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +105,7 @@ namespace qController
|
||||
|
||||
void Connect(object sender, EventArgs e)
|
||||
{
|
||||
App.NavigationPage.Navigation.PushModalAsync(new NavigationPage(new ControlPage(nameLabel.Text,addressLabel.Text)));
|
||||
App.NavigationPage.Navigation.PushAsync(new ControlPage(nameLabel.Text,addressLabel.Text));
|
||||
|
||||
Console.WriteLine("Connect To " + nameLabel.Text + " Pressed");
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ namespace qController
|
||||
Label number;
|
||||
Label type;
|
||||
Label notes;
|
||||
|
||||
public QSelectedCueCell()
|
||||
{
|
||||
Padding = new Thickness(5);
|
||||
@@ -66,23 +65,29 @@ namespace qController
|
||||
}
|
||||
};
|
||||
|
||||
number = new Label { Text = "N/A"};
|
||||
number.FontAttributes = FontAttributes.Bold;
|
||||
number.FontSize = 30;
|
||||
number.Margin = new Thickness(5);
|
||||
number = new Label {
|
||||
Text = "N/A",
|
||||
FontAttributes = FontAttributes.Bold,
|
||||
FontSize = 30,
|
||||
Margin = new Thickness(5)
|
||||
};
|
||||
|
||||
name = new Label {
|
||||
Text = "N/A",
|
||||
FontAttributes = FontAttributes.Bold,
|
||||
HorizontalTextAlignment = TextAlignment.Center,
|
||||
FontSize = 20,
|
||||
Margin = new Thickness(0)
|
||||
};
|
||||
|
||||
name = new Label { Text = "N/A" };
|
||||
name.FontAttributes = FontAttributes.Bold;
|
||||
name.HorizontalTextAlignment = TextAlignment.Center;
|
||||
name.FontSize = 20;
|
||||
name.Margin = new Thickness(0);
|
||||
|
||||
type = new Label { Text = "N/A" };
|
||||
type.FontAttributes = FontAttributes.Bold;
|
||||
type.VerticalTextAlignment = TextAlignment.Center;
|
||||
type.HorizontalTextAlignment = TextAlignment.End;
|
||||
type.Margin = new Thickness(5);
|
||||
type = new Label {
|
||||
Text = "",
|
||||
FontFamily = App.QFont,
|
||||
VerticalTextAlignment = TextAlignment.Center,
|
||||
HorizontalTextAlignment = TextAlignment.End,
|
||||
Margin = new Thickness(5),
|
||||
FontSize = 27
|
||||
};
|
||||
|
||||
notes = new Label { Text = "Viewing Notes Currently Unavailable" };
|
||||
notes.HorizontalTextAlignment = TextAlignment.Center;
|
||||
@@ -112,7 +117,7 @@ namespace qController
|
||||
{
|
||||
name.Text = cue.name;
|
||||
number.Text = cue.number;
|
||||
type.Text = cue.type;
|
||||
type.Text = cue.getIconString();
|
||||
notes.Text = cue.notes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class IPHelper
|
||||
{
|
||||
public IPHelper()
|
||||
{
|
||||
}
|
||||
|
||||
public static bool IsValidAddress(string ipString){
|
||||
if ((ipString.Split('.').Length - 1) != 3) return false;
|
||||
IPAddress address;
|
||||
return IPAddress.TryParse(ipString, out address);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,12 +12,16 @@ namespace qController
|
||||
public QParser qParser;
|
||||
public QReceiver qReceiver;
|
||||
|
||||
string Address;
|
||||
int Port;
|
||||
public QClient(string address, int port)
|
||||
{
|
||||
Address = address;
|
||||
Port = port;
|
||||
qParser = new QParser();
|
||||
qReceiver = new QReceiver(port + 1);
|
||||
tcpSender = new TCPSender(address, port);
|
||||
udpSender = new UDPSender(address, port);
|
||||
qReceiver = new QReceiver(Port + 1);
|
||||
tcpSender = new TCPSender(Address, Port);
|
||||
udpSender = new UDPSender(Address, Port);
|
||||
|
||||
tcpSender.MessageReceived += OnMessageReceived;
|
||||
qReceiver.UpdateMessageReceived += OnMessageReceived;
|
||||
@@ -44,11 +48,15 @@ namespace qController
|
||||
}
|
||||
public void sendStringUDP(string address)
|
||||
{
|
||||
udpSender = new UDPSender(Address,Port);
|
||||
udpSender.Send(new OscMessage(address));
|
||||
udpSender.Close();
|
||||
}
|
||||
public void sendArgsUDP(string address, params object[] args)
|
||||
{
|
||||
udpSender = new UDPSender(Address, Port);
|
||||
udpSender.Send(new OscMessage(address, args));
|
||||
udpSender.Close();
|
||||
}
|
||||
public void sendAndReceiveString(string address)
|
||||
{
|
||||
|
||||
@@ -26,5 +26,64 @@ namespace qController
|
||||
public string displayName { get; set; }
|
||||
public bool isLoaded { get; set; }
|
||||
public string notes { get; set; }
|
||||
|
||||
public string getIconString()
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case "Group":
|
||||
return "\uF248";
|
||||
case "Audio":
|
||||
return "\uE807";
|
||||
case "Mic":
|
||||
return "\uF130";
|
||||
case "Video":
|
||||
return "\uE805";
|
||||
case "Camera":
|
||||
return "\uE806";
|
||||
case "Text":
|
||||
return "T";
|
||||
case "Light":
|
||||
return "\uF0EB";
|
||||
case "Fade":
|
||||
return "\uF1DE";
|
||||
case "Network":
|
||||
return "\uF192";
|
||||
case "MIDI":
|
||||
return "";
|
||||
case "MIDI File":
|
||||
return "\uE804";
|
||||
case "Timecode":
|
||||
return "\uE808";
|
||||
case "Start":
|
||||
return "\uE809";
|
||||
case "Stop":
|
||||
return "\uE80A";
|
||||
case "Pause":
|
||||
return "\uE80B";
|
||||
case "Load":
|
||||
return "\uE80E";
|
||||
case "Reset":
|
||||
return "\uE80F";
|
||||
case "Devamp":
|
||||
return "\uE80C";
|
||||
case "GoTo":
|
||||
return "\uF178";
|
||||
case "Target":
|
||||
return "\uE80D";
|
||||
case "Arm":
|
||||
return "\uE810";
|
||||
case "Disarm":
|
||||
return "";
|
||||
case "Wait":
|
||||
return "\uF250";
|
||||
case "Memo":
|
||||
return "\uF27B";
|
||||
case "Script":
|
||||
return "\uE811";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
using System;
|
||||
namespace qController
|
||||
{
|
||||
public class QGrid
|
||||
{
|
||||
|
||||
public QGrid()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user