Exemple #1
0
        public int sceAudioChangeChannelConfig(int ChannelId, PspAudio.FormatEnum Format)
        {
            var Channel = HleState.PspAudio.GetChannel(ChannelId);

            Channel.Format = Format;
            return(0);
        }
Exemple #2
0
        public int sceAudioChangeChannelConfig(int ChannelId, PspAudio.FormatEnum Format)
        {
            var Channel = GetChannel(ChannelId);

            Channel.Format = Format;
            Channel.Updated();
            return(0);
        }
Exemple #3
0
        public int sceAudioChReserve(CpuThreadState CpuThreadState, int ChannelId, int SampleCount,
                                     PspAudio.FormatEnum Format)
        {
            var RetChannelId = _sceAudioChReserve(ChannelId, SampleCount, Format);

            CpuThreadState.Reschedule();
            //ThreadManager.
            return(RetChannelId);
        }
Exemple #4
0
        private int _sceAudioChReserve(int ChannelId, int SampleCount, PspAudio.FormatEnum Format)
        {
            if (!IsValidSampleCount(SampleCount))
            {
                throw (new SceKernelException(SceKernelErrors.ERROR_AUDIO_OUTPUT_SAMPLE_DATA_SIZE_NOT_ALIGNED));
            }

            return(_sceAudioChReserve(
                       () => GetChannel(ChannelId, CanAlloc: true),
                       SampleCount,
                       Format
                       ));
        }
Exemple #5
0
 public int sceAudioChReserve(int ChannelId, int SampleCount, PspAudio.FormatEnum Format)
 {
     try
     {
         var Channel = HleState.PspAudio.GetChannel(ChannelId);
         Channel.SampleCount = SampleCount;
         Channel.Format      = Format;
         return(Channel.Index);
     }
     catch (Exception Exception)
     {
         Console.Error.WriteLine(Exception);
         return(-1);
     }
 }
Exemple #6
0
        private int _sceAudioChReserve(Func <PspAudioChannel> ChannelGet, int SampleCount, PspAudio.FormatEnum Format)
        {
            if (!Enum.IsDefined(typeof(PspAudio.FormatEnum), Format))
            {
                throw (new SceKernelException(SceKernelErrors.ERROR_AUDIO_INVALID_FORMAT));
            }

            try
            {
                var Channel = ChannelGet();
                if (!Channel.Available)
                {
                    throw (new InvalidChannelException());
                }
                Channel.Available   = false;
                Channel.SampleCount = SampleCount;
                Channel.Format      = Format;
                Channel.Updated();
                return(Channel.Index);
            }
            catch (NoChannelsAvailableException)
            {
                throw (new SceKernelException(SceKernelErrors.ERROR_AUDIO_NO_CHANNELS_AVAILABLE));
            }
            catch (InvalidChannelException)
            {
                throw (new SceKernelException(SceKernelErrors.ERROR_AUDIO_INVALID_CHANNEL));
            }
        }