private bool ReportChannelPosition(Channel? channel, string trackId, AudioTypes audioType, ref int? lastPos)
{
if (channel.HasValue)
{
var chn = channel.Value;
int? pos = (int?)chn.GetPosition(TimeUnit.Milliseconds);
if (pos == lastPos)
return false;
lastPos = pos;
if (pos.HasValue)
{
SendMessage(new AudioPositionChanged
{
Id = trackId,
Type = audioType,
Position = pos.Value
});
return true;
}
}
lastPos = null;
return false;
}