Пример #1
0
        // GetWorkBufferSize(nn::audio::detail::AudioRendererParameterInternal parameter) -> u64 workBufferSize
        public ResultCode GetAudioRendererWorkBufferSize(ServiceCtx context)
        {
            AudioRendererConfiguration parameter = context.RequestData.ReadStruct <AudioRendererConfiguration>();

            if (BehaviourContext.CheckValidRevision(parameter.Revision))
            {
                ulong size = _impl.GetWorkBufferSize(ref parameter);

                context.ResponseData.Write(size);

                Logger.Debug?.Print(LogClass.ServiceAudio, $"WorkBufferSize is 0x{size:x16}.");

                return(ResultCode.Success);
            }
            else
            {
                context.ResponseData.Write(0L);

                Logger.Warning?.Print(LogClass.ServiceAudio, $"Library Revision REV{BehaviourContext.GetRevisionNumber(parameter.Revision)} is not supported!");

                return(ResultCode.UnsupportedRevision);
            }
        }