Files

46 lines
1.5 KiB
C#
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.Common.Classes.Hardware
{
public class SerializableAAF
{
public enum DAS_TYPE { TDAS = 0, SLICE = 1 };
/*private DAS_TYPE _type = DAS_TYPE.TDAS;
public DAS_TYPE DasType { get { return _type; } }
private UInt64 _sampleRate = 0;
public UInt64 SampleRate { get { return _sampleRate; } }
private float _aaf = 0F;
public float AAF { get { return _aaf; } }
public SerializableAAF(DAS_TYPE type, ulong sps, float aaf)
{
_type = type;
_sampleRate = sps;
_aaf = aaf;
}
private const string SEPARATOR = "_x_";
public string GetSerializedKey()
{
return string.Format("{0}{1}{2}", (int)DasType, SEPARATOR, SampleRate);
}
public string GetSerializedValue()
{
return AAF.ToString(System.Globalization.CultureInfo.InvariantCulture);
}
public void FromSerializedStrings(string key, string value)
{
string[] tokens = key.Split(new string[] { SEPARATOR }, StringSplitOptions.None);
if (2 != tokens.Length) { throw new NotSupportedException("Invalid Format AAF key: " + key.ToArray()); }
_type = (DAS_TYPE)Convert.ToInt32(tokens[0]);
_sampleRate = Convert.ToUInt64(tokens[1]);
_aaf = Convert.ToSingle(value);
}*/
}
}