Minor cleanup
This commit is contained in:
parent
eb72ff9053
commit
47fa5bcb7c
|
@ -83,8 +83,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sound refactor TODO: combine these methods, and check the SyncMode for behavior
|
// Sound refactor TODO: combine these methods, and check the SyncMode for behavior
|
||||||
|
/// <summary>
|
||||||
|
/// attach a new input pin, of the `sync` variety
|
||||||
|
/// </summary>
|
||||||
public void SetSyncInputPin(ISoundProvider source)
|
public void SetSyncInputPin(ISoundProvider source)
|
||||||
{
|
{
|
||||||
|
if (source.SyncMode != SyncSoundMode.Sync)
|
||||||
|
throw new InvalidOperationException("SetSyncInputPin() must be called with a sync input");
|
||||||
|
|
||||||
_semiSync.DiscardSamples();
|
_semiSync.DiscardSamples();
|
||||||
_semiSync.ClearSoundProvider();
|
_semiSync.ClearSoundProvider();
|
||||||
_soundProvider = source;
|
_soundProvider = source;
|
||||||
|
@ -94,8 +100,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// attach a new input pin, of the `async` variety
|
||||||
|
/// </summary>
|
||||||
public void SetAsyncInputPin(ISoundProvider source)
|
public void SetAsyncInputPin(ISoundProvider source)
|
||||||
{
|
{
|
||||||
|
if (source.SyncMode != SyncSoundMode.Async)
|
||||||
|
throw new InvalidOperationException("SetAsyncInputPin() must be called with a async input");
|
||||||
|
|
||||||
if (_outputProvider != null)
|
if (_outputProvider != null)
|
||||||
{
|
{
|
||||||
_outputProvider.DiscardSamples();
|
_outputProvider.DiscardSamples();
|
||||||
|
@ -160,7 +172,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
int samplesNeeded = _soundOutput.CalculateSamplesNeeded();
|
int samplesNeeded = _soundOutput.CalculateSamplesNeeded();
|
||||||
int samplesProvided;
|
int samplesProvided;
|
||||||
|
|
||||||
if (atten==0)
|
if (atten == 0)
|
||||||
{
|
{
|
||||||
samples = new short[samplesNeeded * ChannelCount];
|
samples = new short[samplesNeeded * ChannelCount];
|
||||||
samplesProvided = samplesNeeded;
|
samplesProvided = samplesNeeded;
|
||||||
|
@ -168,7 +180,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (_soundProvider != null) _soundProvider.DiscardSamples();
|
if (_soundProvider != null) _soundProvider.DiscardSamples();
|
||||||
if (_outputProvider != null) _outputProvider.DiscardSamples();
|
if (_outputProvider != null) _outputProvider.DiscardSamples();
|
||||||
}
|
}
|
||||||
else if ( _soundProvider.SyncMode == SyncSoundMode.Sync)
|
else if (_soundProvider.SyncMode == SyncSoundMode.Sync)
|
||||||
{
|
{
|
||||||
if (Global.Config.SoundThrottle)
|
if (Global.Config.SoundThrottle)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue