Skip to content

Commit

Permalink
DMX support (from #670), "All Settings" tab, and more setting categor…
Browse files Browse the repository at this point in the history
…ies (#682)

* DMX support, "Advanced" tab, Stagekit toggle (#670)

* DMX support

Added scan (dmx over ethernet) support. Added an advanced settings tab. Added ability to turn off the stage kit.

* fixed var names

* Moved things to correct spots

* Refactored into a MonoSingleton

* Added README to note changes

---------

Co-authored-by: EliteAsian <29520859+EliteAsian123@users.noreply.github.com>

* Fix some things up

* Make it so settings don't use tab in unlocalized name

* Started "All Settings" menu

* Split up advanced settings into their own categories and added some more buttons

* Fixed a small bug that Jaden would totally fine 10 seconds after this update releases

* Updated setting category view to concept

* Updated search bar

* Updated placeholder text styling

* Added basic search functionality

* Limit number of results

* Fixed scrolling on scroll views

* Make the search results clickable

* Added more icons

* Prevent SacnController from initializing twice

---------

Co-authored-by: TheFatBastid <tfb@sof.ws>
  • Loading branch information
EliteAsian123 and TheFatBastid committed Feb 11, 2024
1 parent 9adf954 commit af294fe
Show file tree
Hide file tree
Showing 112 changed files with 7,106 additions and 939 deletions.
2 changes: 2 additions & 0 deletions Assembly-CSharp.csproj.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cscript_005Cmenu_005Cprofiles_005Cinputcontroldialog/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cscript_005Cmenu_005Cprofiles_005Cinputdevicedialog/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cscript_005Cmenu_005Cscorescreen_005Cscorecards/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cscript_005Cmenu_005Csettings_005Cpresets/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cscript_005Cmenu_005Csettings_005Csongmanager/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cscript_005Cobsolete/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cscript_005Cpersistent/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cscript_005Csettings_005Ccustomization_005Ccamerasettings/@EntryIndexedValue">True</s:Boolean>
Expand Down
4 changes: 2 additions & 2 deletions Assets/Art/Menu/Common/Icons/AssortedIcons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 23 additions & 1 deletion Assets/Art/Menu/Common/Icons/AssortedIcons.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Assets/Art/Menu/Common/Icons/TabIcons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 68 additions & 2 deletions Assets/Art/Menu/Common/Icons/TabIcons.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Plugins/Haukcode.sACN.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

111 changes: 111 additions & 0 deletions Assets/Plugins/Haukcode.sACN/BigEndianBinaryWriter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
using System;
using System.Linq;
using System.Text;

namespace Haukcode.sACN
{
internal class BigEndianBinaryWriter
{
private int writePosition = 0;
private readonly Memory<byte> buffer;

public BigEndianBinaryWriter(Memory<byte> buffer)
{
this.buffer = buffer;
}

public int WrittenBytes => writePosition;

public Memory<byte> Memory => buffer.Slice(writePosition);

public void WriteByte(byte value)
{
var span = buffer.Span;

span[writePosition++] = (byte)value;
}

public void WriteShort(short value)
{
var span = buffer.Span;

span[writePosition++] = (byte)(value >> 8);
span[writePosition++] = (byte)value;
}

public void WriteUShort(ushort value)
{
var span = buffer.Span;

span[writePosition++] = (byte)(value >> 8);
span[writePosition++] = (byte)value;
}

public void WriteInt32(int value)
{
var span = buffer.Span;

span[writePosition++] = (byte)(value >> 24);
span[writePosition++] = (byte)(value >> 16);
span[writePosition++] = (byte)(value >> 8);
span[writePosition++] = (byte)value;
}

public void WriteBytes(byte[] bytes)
{
bytes.CopyTo(buffer[writePosition..].Span);

writePosition += bytes.Length;
}

public void WriteBytes(ReadOnlyMemory<byte> bytes)
{
bytes.Span.CopyTo(buffer[writePosition..].Span);

writePosition += bytes.Length;
}

public void WriteString(string value, int length)
{
//FIXME
WriteBytes(Encoding.UTF8.GetBytes(value));
WriteBytes(Enumerable.Repeat((byte)0, length - value.Length).ToArray());
}

private byte[] GuidToByteArray(Guid input)
{
var bytes = input.ToByteArray();

return new byte[] {
bytes[3],
bytes[2],
bytes[1],
bytes[0],

bytes[5],
bytes[4],

bytes[7],
bytes[6],

bytes[8],
bytes[9],

bytes[10],
bytes[11],
bytes[12],
bytes[13],
bytes[14],
bytes[15]
};
}

public void WriteGuid(Guid value)
{
// Fixme
var bytes = GuidToByteArray(value);

WriteBytes(bytes);
}
}
}
11 changes: 11 additions & 0 deletions Assets/Plugins/Haukcode.sACN/BigEndianBinaryWriter.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Plugins/Haukcode.sACN/Model.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions Assets/Plugins/Haukcode.sACN/Model/DMPLayer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;

namespace Haukcode.sACN.Model
{
public class DMPLayer
{
public const byte DMP_VECTOR = 2;
public const byte ADDRESS_TYPE_AND_DATA_TYPE = 0xA1;
public const short FIRST_PROPERTY_ADDRESS = 0x00;
public const short ADDRESS_INCREMENT = 1;

public byte StartCode { get; set; }

public short Length { get { return (short)(11 + Data.Length); } }

public ReadOnlyMemory<byte> Data { get; set; }

public DMPLayer(ReadOnlyMemory<byte> data, byte startCode = 0x00)
{
Data = data;
StartCode = startCode;
}

public int WriteToBuffer(Memory<byte> buffer)
{
var writer = new BigEndianBinaryWriter(buffer);

ushort flagsAndDMPLength = (ushort)(SACNDataPacket.FLAGS | (ushort)Length);

writer.WriteUShort(flagsAndDMPLength);
writer.WriteByte(DMP_VECTOR);
writer.WriteByte(ADDRESS_TYPE_AND_DATA_TYPE);
writer.WriteShort(FIRST_PROPERTY_ADDRESS);
writer.WriteShort(ADDRESS_INCREMENT);
writer.WriteShort((short)(Data.Length + 1));
writer.WriteByte(StartCode);
writer.WriteBytes(Data);

return writer.WrittenBytes;
}
}
}
11 changes: 11 additions & 0 deletions Assets/Plugins/Haukcode.sACN/Model/DMPLayer.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit af294fe

Please sign in to comment.