2021-02-26 00:11:56 +00:00
|
|
|
|
// Copyright (c) 2019-2021 Ryujinx
|
2020-08-18 01:49:37 +00:00
|
|
|
|
//
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program 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 Lesser General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
//
|
|
|
|
|
|
2021-02-26 00:11:56 +00:00
|
|
|
|
using Ryujinx.Audio.Integration;
|
|
|
|
|
|
|
|
|
|
namespace Ryujinx.Audio.Common
|
2020-08-18 01:49:37 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2021-02-26 00:11:56 +00:00
|
|
|
|
/// Represent an audio buffer that will be used by an <see cref="IHardwareDeviceSession"/>.
|
2020-08-18 01:49:37 +00:00
|
|
|
|
/// </summary>
|
2021-02-26 00:11:56 +00:00
|
|
|
|
public class AudioBuffer
|
2020-08-18 01:49:37 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2021-02-26 00:11:56 +00:00
|
|
|
|
/// Unique tag of this buffer.
|
2020-08-18 01:49:37 +00:00
|
|
|
|
/// </summary>
|
2021-02-26 00:11:56 +00:00
|
|
|
|
/// <remarks>Unique per session</remarks>
|
|
|
|
|
public ulong BufferTag;
|
2020-08-18 01:49:37 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-02-26 00:11:56 +00:00
|
|
|
|
/// Pointer to the user samples.
|
2020-08-18 01:49:37 +00:00
|
|
|
|
/// </summary>
|
2021-02-26 00:11:56 +00:00
|
|
|
|
public ulong DataPointer;
|
2020-08-18 01:49:37 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-02-26 00:11:56 +00:00
|
|
|
|
/// Size of the user samples region.
|
2020-08-18 01:49:37 +00:00
|
|
|
|
/// </summary>
|
2021-02-26 00:11:56 +00:00
|
|
|
|
public ulong DataSize;
|
2020-08-18 01:49:37 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-02-26 00:11:56 +00:00
|
|
|
|
/// The timestamp at which the buffer was played.
|
2020-08-18 01:49:37 +00:00
|
|
|
|
/// </summary>
|
2021-02-26 00:11:56 +00:00
|
|
|
|
/// <remarks>Not used but useful for debugging</remarks>
|
|
|
|
|
public ulong PlayedTimestamp;
|
2020-08-18 01:49:37 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-02-26 00:11:56 +00:00
|
|
|
|
/// The user samples.
|
2020-08-18 01:49:37 +00:00
|
|
|
|
/// </summary>
|
2021-02-26 00:11:56 +00:00
|
|
|
|
public byte[] Data;
|
2020-08-18 01:49:37 +00:00
|
|
|
|
}
|
|
|
|
|
}
|