CSPspEmu.Hle.Modules.audio.sceAudio.sceAudioChangeChannelVolume C# (CSharp) Method

sceAudioChangeChannelVolume() private method

private sceAudioChangeChannelVolume ( int ChannelId, int VolumeLeft, int VolumeRight ) : int
ChannelId int
VolumeLeft int
VolumeRight int
return int
        public int sceAudioChangeChannelVolume(int ChannelId, int VolumeLeft, int VolumeRight)
        {
            var Channel = GetChannel(ChannelId);

            if (VolumeLeft > 0xFFFF || VolumeRight > 0xFFFF) {
                throw(new SceKernelException(SceKernelErrors.ERROR_AUDIO_INVALID_VOLUME));
            }

            if (!Channel.IsReserved)
            {
                throw (new SceKernelException(SceKernelErrors.ERROR_AUDIO_CHANNEL_NOT_RESERVED));
            }

            if (VolumeLeft >= 0) Channel.VolumeLeft = VolumeLeft;
            if (VolumeRight >= 0) Channel.VolumeRight = VolumeRight;

            return 0;
        }