﻿/* Copyright © 2018 Jeremy Herbison

This file is part of AudioWorks.

AudioWorks is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
version.

AudioWorks is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.

You should have received a copy of the GNU Affero General Public License along with AudioWorks. If not, see
<https://www.gnu.org/licenses/>. */

using System.Runtime.InteropServices;

namespace AudioWorks.Extensions.Flac
{
    [StructLayout(LayoutKind.Sequential)]
    readonly struct StreamInfo
    {
        readonly uint MinBlockSize;

        readonly uint MaxBlockSize;

        readonly uint MinFrameSize;

        readonly uint MaxFrameSize;

        internal readonly uint SampleRate;

        internal readonly uint Channels;

        internal readonly uint BitsPerSample;

        internal readonly ulong TotalSamples;

        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] readonly byte[] Md5Sum;
    }
}
﻿/* Copyright © 2018 Jeremy Herbison

This file is part of AudioWorks.

AudioWorks is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
version.

AudioWorks is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.

You should have received a copy of the GNU Affero General Public License along with AudioWorks. If not, see
<https://www.gnu.org/licenses/>. */

using System.Runtime.InteropServices;

namespace AudioWorks.Extensions.Flac
{
    [StructLayout(LayoutKind.Sequential)]
    unsafe struct StreamInfo
    {
        readonly uint MinBlockSize;

        readonly uint MaxBlockSize;

        readonly uint MinFrameSize;

        readonly uint MaxFrameSize;

        internal readonly uint SampleRate;

        internal readonly uint Channels;

        internal readonly uint BitsPerSample;

        internal readonly ulong TotalSamples;

        fixed byte Md5Sum[16];
    }
}
Use a fixed size buffer rather than marshalling
Use a fixed size buffer rather than marshalling
