-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
…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
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.