Inheritance: IInjectInitialize, IDisposable
Esempio n. 1
0
 public int sceAudioChangeChannelConfig(int ChannelId, PspAudio.FormatEnum Format)
 {
     var Channel = PspAudio.GetChannel(ChannelId);
     Channel.Format = Format;
     Channel.Updated();
     return 0;
 }
Esempio n. 2
0
 public override void InitializeComponent()
 {
     PspAudio = PspEmulatorContext.GetInstance<PspAudio>();
 }
Esempio n. 3
0
		public int sceAudioChReserve(int ChannelId, int SampleCount, PspAudio.FormatEnum Format)
		{
			try
			{
				var Channel = PspAudio.GetChannel(ChannelId, CanAlloc: true);
				Channel.SampleCount = SampleCount;
				Channel.Format = Format;
				Channel.Updated();
				return Channel.Index;
			}
			catch (Exception Exception)
			{
				Console.Error.WriteLine(Exception);
				return -1;
			}
		}
Esempio n. 4
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="PspAudio"></param>
		public PspAudioChannel(PspAudio PspAudio)
		{
			this.PspAudio = PspAudio;
		}
Esempio n. 5
0
 public int sceAudioChangeChannelConfig(int ChannelId, PspAudio.FormatEnum Format)
 {
     var Channel = HleState.PspAudio.GetChannel(ChannelId);
     Channel.Format = Format;
     return 0;
 }
Esempio n. 6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="PspAudio"></param>
 public PspAudioChannel(PspAudio PspAudio)
 {
     this.PspAudio = PspAudio;
 }
Esempio n. 7
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
            );
        }
Esempio n. 8
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));
            }
        }
Esempio n. 9
0
 public int sceAudioChReserve(CpuThreadState CpuThreadState, int ChannelId, int SampleCount, PspAudio.FormatEnum Format)
 {
     var RetChannelId = _sceAudioChReserve(ChannelId, SampleCount, Format);
     CpuThreadState.Reschedule();
     //ThreadManager.
     return RetChannelId;
 }