Skip to content

Commit

Permalink
VIX-3439 Create Vixen Player FSEQ Reader
Browse files Browse the repository at this point in the history
VIX-3439 Create Vixen Player FSEQ Reader
  • Loading branch information
johncbaur committed Jul 6, 2023
1 parent 9f3f1fb commit 02c35f1
Show file tree
Hide file tree
Showing 6 changed files with 661 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Vixen.sln
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,10 @@ Project("{B7DD6F7E-DEF8-4E67-B5B7-07EF123DB6F0}") = "Vixen.Installer", "src\Vixe
EndProject
Project("{B7DD6F7E-DEF8-4E67-B5B7-07EF123DB6F0}") = "Vixen.DeployBundle", "src\Vixen.DeployBundle\Vixen.DeployBundle.wixproj", "{8696BB96-E975-4A6B-9033-5E2F54C87CFA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Vixen.Player", "Vixen.Player", "{53916538-57B8-4AE1-92FF-A9CA5E9CB380}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSEQReader", "src\Vixen.Player\FSEQReader\FSEQReader.csproj", "{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -2269,6 +2273,18 @@ Global
{8696BB96-E975-4A6B-9033-5E2F54C87CFA}.Deploy|x86.Build.0 = Release|x86
{8696BB96-E975-4A6B-9033-5E2F54C87CFA}.Release|x64.ActiveCfg = Release|x64
{8696BB96-E975-4A6B-9033-5E2F54C87CFA}.Release|x86.ActiveCfg = Release|x86
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}.Debug|x64.ActiveCfg = Debug|x64
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}.Debug|x64.Build.0 = Debug|x64
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}.Debug|x86.ActiveCfg = Debug|x86
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}.Debug|x86.Build.0 = Debug|x86
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}.Deploy|x64.ActiveCfg = Debug|x64
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}.Deploy|x64.Build.0 = Debug|x64
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}.Deploy|x86.ActiveCfg = Debug|x86
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}.Deploy|x86.Build.0 = Debug|x86
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}.Release|x64.ActiveCfg = Release|x64
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}.Release|x64.Build.0 = Release|x64
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}.Release|x86.ActiveCfg = Release|x86
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -2436,6 +2452,7 @@ Global
{B083141A-CA04-4E12-87C5-1E75D44E930D} = {783CEFCF-DBF1-4ED1-B6D3-886B6583097D}
{68E893A1-E452-48E1-992F-F3F780829BB8} = {791B683A-4B1A-4667-9FCC-7C61683C1448}
{5C5A2695-3DE7-4C25-9DE1-261B8F3C0DF7} = {783CEFCF-DBF1-4ED1-B6D3-886B6583097D}
{4CDECE55-8694-4B9A-B753-6B5C29FCB5B7} = {53916538-57B8-4AE1-92FF-A9CA5E9CB380}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5957242E-E882-44E4-83E0-A1C2F73705BF}
Expand Down
33 changes: 33 additions & 0 deletions src/Vixen.Player/FSEQReader/ControllerInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace VixenPlayer.FSeqReader
{
/// <summary>
/// Maintains frame data for a controller.
/// </summary>
public class ControllerInfo : IControllerInfo
{
#region Constructor

/// <summary>
/// Constructor
/// </summary>
public ControllerInfo()
{
FrameData = new List<byte[]>();
}

#endregion

#region IControllerInfo

/// <inheritdoc/>
public Guid ID { get; set; }

/// <inheritdoc/>
public int NumberOfChannels { get; set; }

/// <inheritdoc/>
public List<byte[]> FrameData { get; private set; }

#endregion
}
}
19 changes: 19 additions & 0 deletions src/Vixen.Player/FSEQReader/FSEQReader.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Vixen.Core\Vixen.Core.csproj" />
</ItemGroup>

</Project>
23 changes: 23 additions & 0 deletions src/Vixen.Player/FSEQReader/IControllerInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace VixenPlayer.FSeqReader
{
/// <summary>
/// Maintains frame data for a controller.
/// </summary>
public interface IControllerInfo
{
/// <summary>
/// ID of the controller.
/// </summary>
public Guid ID { get; set; }

/// <summary>
/// Number of channels associated with the controller.
/// </summary>
public int NumberOfChannels { get; set; }

/// <summary>
/// Frame data for the controller.
/// </summary>
public List<byte[]> FrameData { get; }
}
}
75 changes: 75 additions & 0 deletions src/Vixen.Player/FSEQReader/IFSeqReader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using System.IO;

namespace VixenPlayer.FSeqReader
{
/// <summary>
/// Reads an fseq file.
/// </summary>
public interface IFSeqReader
{
/// <summary>
/// Reads a Vixen Player fseq file.
/// </summary>
/// <param name="reader">Binary file reader</param>
/// <param name="onlyReadHeader">Flag to only read the header information</param>
/// <param name="skipReadingData">Flag to skip reading the frame data</param>
void ReadFileHeader(BinaryReader reader, bool onlyReadHeader = false, bool skipReadingData = false);

/// <summary>
/// File identifier (usually 'PSEQ').
/// </summary>
string FileIdentifier { get; }

/// <summary>
/// Version of the fseq file.
/// </summary>
string Version { get; }

/// <summary>
/// Number of channels per frame of data.
/// </summary>
UInt32 ChannelsPerFrame { get; }

/// <summary>
/// Step time or refresh rate in milliseconds.
/// </summary>
int StepTime { get; }

/// <summary>
/// True when compression is enabled.
/// </summary>
bool CompressionEnabled { get; }

/// <summary>
/// Number of data frames in the file.
/// </summary>
UInt32 NumberOfFrames { get; }

/// <summary>
/// Frame data contained in the file.
/// </summary>
List<Byte[]> FrameData { get; }

/// <summary>
/// Sequence audio file name.
/// </summary>
string SequenceAudioFileName { get; set; }

// NOTE: The following properties are from the Vixen Player extended data variable header.

/// <summary>
/// Version of the Vixen Player extended data variable length header.
/// </summary>
string VixenPlayerHeaderVersion { get; }

/// <summary>
/// Controller frame data contained in the file.
/// </summary>
List<IControllerInfo> ControllerInfo { get; }

/// <summary>
/// Time stamp of the sequence used to make the file.
/// </summary>
DateTime SequenceTimeStamp { get; set; }
}
}
Loading

0 comments on commit 02c35f1

Please sign in to comment.