a few more comments on the new sound stuff

This commit is contained in:
goyuken 2012-10-11 01:14:14 +00:00
parent 92827272a6
commit 99f6bbb8e4
2 changed files with 16 additions and 4 deletions

View File

@ -7,17 +7,26 @@ namespace BizHawk
public interface IEmulator : IDisposable
{
IVideoProvider VideoProvider { get; }
/// <summary>
/// sound provider for async operation. this is optional, and is only required after StartAsyncSound() is called and returns true
/// </summary>
ISoundProvider SoundProvider { get; }
/// <summary>
/// sound provider for sync operation. this is manditory
/// </summary>
ISyncSoundProvider SyncSoundProvider { get; }
/// <summary></summary>
/// <returns>false if core doesn't support async sound</returns>
/// <summary>start async operation. (on construct, sync operation is assumed).</summary>
/// <returns>false if core doesn't support async sound; SyncSoundProvider will continue to be used in that case</returns>
bool StartAsyncSound();
/// <summary>
/// end async operation, returning to sync operation. after this, all sound requests will go to the SyncSoundProvider
/// </summary>
void EndAsyncSound();
ControllerDefinition ControllerDefinition { get; }
IController Controller { get; set; }
// note that most cores expect you to call SoundProvider.GetSamples() after each FrameAdvance()
// note that some? cores expect you to call SoundProvider.GetSamples() after each FrameAdvance()
// please do this, even when rendersound = false
void FrameAdvance(bool render, bool rendersound = true);

View File

@ -14,6 +14,9 @@
void DiscardSamples();
}
/// <summary>
/// wraps an ISyncSoundProvider around an ISoundProvider
/// </summary>
public class FakeSyncSound : ISyncSoundProvider
{
ISoundProvider source;
@ -22,7 +25,7 @@
///
/// </summary>
/// <param name="source"></param>
/// <param name="spf">number of sample pairs to request for each call</param>
/// <param name="spf">number of sample pairs to request and provide on each GetSamples() call</param>
public FakeSyncSound(ISoundProvider source, int spf)
{
this.source = source;