Skip to content

Commit

Permalink
Handle multiple destinations and FSEQ improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
HakanL committed Aug 19, 2022
1 parent 1dcb51b commit a0a7f54
Show file tree
Hide file tree
Showing 16 changed files with 387 additions and 123 deletions.
2 changes: 2 additions & 0 deletions Utils/DMXrecorder/Common/BaseDmxFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class BaseDmxFrame
{
public int SyncAddress { get; set; }

public System.Net.IPAddress Destination { get; set; }

public BaseDmxFrame()
{
}
Expand Down
6 changes: 4 additions & 2 deletions Utils/DMXrecorder/Common/DmxDataFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ public DmxDataFrame(DmxDataFrame source)
Data = source.Data;
UniverseId = source.UniverseId;
SyncAddress = source.SyncAddress;
Destination = source.Destination;
}

public static DmxDataFrame CreateFrame(int universe, int syncAddress, byte[] data)
public static DmxDataFrame CreateFrame(int universe, int syncAddress, byte[] data, System.Net.IPAddress destination)
{
return new DmxDataFrame
{
UniverseId = universe,
SyncAddress = syncAddress,
Data = data
Data = data,
Destination = destination
};
}

Expand Down
8 changes: 4 additions & 4 deletions Utils/DMXrecorder/Common/DmxDataOutputPacket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ public DmxDataOutputPacket()
{
}

public static DmxDataOutputPacket CreateFullFrame(double millisecond, long sequence, int universe, byte[] data, int syncAddress)
public static DmxDataOutputPacket CreateFullFrame(double millisecond, long sequence, int universe, System.Net.IPAddress destination, byte[] data, int syncAddress)
{
return new DmxDataOutputPacket
{
Content = DmxDataFrame.CreateFrame(universe, syncAddress, data),
Content = DmxDataFrame.CreateFrame(universe, syncAddress, data, destination),
Sequence = sequence,
TimestampMS = millisecond
};
}

public static DmxDataOutputPacket CreateSync(double millisecond, long sequence, int syncAddress)
public static DmxDataOutputPacket CreateSync(double millisecond, long sequence, int syncAddress, System.Net.IPAddress destination)
{
return new DmxDataOutputPacket
{
Content = SyncFrame.CreateFrame(syncAddress),
Content = SyncFrame.CreateFrame(syncAddress, destination),
Sequence = sequence,
TimestampMS = millisecond
};
Expand Down
11 changes: 11 additions & 0 deletions Utils/DMXrecorder/Common/FileFormatProber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ public static class FileFormatProber
{
}

try
{
using var testReader = new Common.IO.FseqFileReader(filename);
testReader.ReadFrame();

return Common.FileFormats.FSeq;
}
catch (InvalidDataException)
{
}

return null;
}
}
Expand Down
Loading

0 comments on commit a0a7f54

Please sign in to comment.