public int sceAudioChangeChannelConfig(int ChannelId, PspAudio.FormatEnum Format) { var Channel = PspAudio.GetChannel(ChannelId); Channel.Format = Format; Channel.Updated(); return 0; }
public override void InitializeComponent() { PspAudio = PspEmulatorContext.GetInstance<PspAudio>(); }
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; } }
/// <summary> /// Constructor /// </summary> /// <param name="PspAudio"></param> public PspAudioChannel(PspAudio PspAudio) { this.PspAudio = PspAudio; }
public int sceAudioChangeChannelConfig(int ChannelId, PspAudio.FormatEnum Format) { var Channel = HleState.PspAudio.GetChannel(ChannelId); Channel.Format = Format; return 0; }
/// <summary> /// Constructor /// </summary> /// <param name="PspAudio"></param> public PspAudioChannel(PspAudio PspAudio) { this.PspAudio = PspAudio; }
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 ); }
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)); } }
public int sceAudioChReserve(CpuThreadState CpuThreadState, int ChannelId, int SampleCount, PspAudio.FormatEnum Format) { var RetChannelId = _sceAudioChReserve(ChannelId, SampleCount, Format); CpuThreadState.Reschedule(); //ThreadManager. return RetChannelId; }