NodeIdHelper.cs 825 B

12345678910111213141516171819202122232425262728
  1. namespace Ryujinx.Audio.Renderer.Common
  2. {
  3. /// <summary>
  4. /// Helper for manipulating node ids.
  5. /// </summary>
  6. public static class NodeIdHelper
  7. {
  8. /// <summary>
  9. /// Get the type of a node from a given node id.
  10. /// </summary>
  11. /// <param name="nodeId">Id of the node.</param>
  12. /// <returns>The type of the node.</returns>
  13. public static NodeIdType GetType(int nodeId)
  14. {
  15. return (NodeIdType)(nodeId >> 28);
  16. }
  17. /// <summary>
  18. /// Get the base of a node from a given node id.
  19. /// </summary>
  20. /// <param name="nodeId">Id of the node.</param>
  21. /// <returns>The base of the node.</returns>
  22. public static int GetBase(int nodeId)
  23. {
  24. return (nodeId >> 16) & 0xFFF;
  25. }
  26. }
  27. }