Improve exception docs in BizHawk.Client.EmuHawk
This commit is contained in:
parent
3bab282e8d
commit
060255471b
|
@ -14,6 +14,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private long _soundRemainder; // audio timekeeping for video dumping
|
private long _soundRemainder; // audio timekeeping for video dumping
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">
|
||||||
|
/// <paramref name="asyncSoundProvider"/>'s mode is not <see cref="SyncSoundMode.Async"/>, or
|
||||||
|
/// A/V parameters haven't been set (need to call <see cref="SetAudioParameters"/> and <see cref="SetMovieParameters"/>)
|
||||||
|
/// </exception>
|
||||||
public void DumpAV(IVideoProvider v, ISoundProvider asyncSoundProvider, out short[] samples, out int samplesprovided)
|
public void DumpAV(IVideoProvider v, ISoundProvider asyncSoundProvider, out short[] samples, out int samplesprovided)
|
||||||
{
|
{
|
||||||
// Sound refactor TODO: we could try set it here, but we want the client to be responsible for mode switching? There may be non-trivial complications with when to switch modes that we don't want this object worrying about
|
// Sound refactor TODO: we could try set it here, but we want the client to be responsible for mode switching? There may be non-trivial complications with when to switch modes that we don't want this object worrying about
|
||||||
|
@ -78,6 +82,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException"><paramref name="syncSoundProvider"/>'s mode is not <see cref="SyncSoundMode.Sync"/></exception>
|
||||||
public void DumpAV(IVideoProvider v, ISoundProvider syncSoundProvider, out short[] samples, out int samplesprovided)
|
public void DumpAV(IVideoProvider v, ISoundProvider syncSoundProvider, out short[] samples, out int samplesprovided)
|
||||||
{
|
{
|
||||||
// Sound refactor TODO: we could just set it here, but we want the client to be responsible for mode switching? There may be non-trivial complications with when to switch modes that we don't want this object worrying about
|
// Sound refactor TODO: we could just set it here, but we want the client to be responsible for mode switching? There may be non-trivial complications with when to switch modes that we don't want this object worrying about
|
||||||
|
@ -140,7 +145,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
protected int bits;
|
protected int bits;
|
||||||
protected bool aset = false;
|
protected bool aset = false;
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">already set</exception>
|
||||||
public new virtual void SetMovieParameters(int fpsnum, int fpsden)
|
public new virtual void SetMovieParameters(int fpsnum, int fpsden)
|
||||||
{
|
{
|
||||||
if (vset)
|
if (vset)
|
||||||
|
@ -155,6 +160,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
base.SetMovieParameters(fpsnum, fpsden);
|
base.SetMovieParameters(fpsnum, fpsden);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">already set, or <paramref name="bits"/> is not <c>16</c></exception>
|
||||||
public new virtual void SetAudioParameters(int sampleRate, int channels, int bits)
|
public new virtual void SetAudioParameters(int sampleRate, int channels, int bits)
|
||||||
{
|
{
|
||||||
if (aset)
|
if (aset)
|
||||||
|
@ -180,11 +186,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// this writer will never support this capability
|
// this writer will never support this capability
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">always</exception>
|
||||||
public new virtual void AddFrame(IVideoProvider source)
|
public new virtual void AddFrame(IVideoProvider source)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("Must call AddAV()!");
|
throw new InvalidOperationException("Must call AddAV()!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">always</exception>
|
||||||
public new virtual void AddSamples(short[] samples)
|
public new virtual void AddSamples(short[] samples)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("Must call AddAV()!");
|
throw new InvalidOperationException("Must call AddAV()!");
|
||||||
|
|
|
@ -30,9 +30,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
_currSegment?.Dispose();
|
_currSegment?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>sets the codec token to be used for video compression</summary>
|
||||||
/// sets the codec token to be used for video compression
|
/// <exception cref="ArgumentException"><paramref name="token"/> does not inherit <see cref="AviWriter.CodecToken"/></exception>
|
||||||
/// </summary>
|
|
||||||
public void SetVideoCodecToken(IDisposable token)
|
public void SetVideoCodecToken(IDisposable token)
|
||||||
{
|
{
|
||||||
if (token is CodecToken)
|
if (token is CodecToken)
|
||||||
|
@ -133,10 +132,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>opens an avi file for recording, with <paramref name="nameProvider"/> being used to name files</summary>
|
||||||
/// opens an avi file for recording with the supplied enumerator used to name files.
|
/// <exception cref="InvalidOperationException">no video codec token set</exception>
|
||||||
/// set a video codec token first.
|
|
||||||
/// </summary>
|
|
||||||
public void OpenFile(IEnumerator<string> nameProvider)
|
public void OpenFile(IEnumerator<string> nameProvider)
|
||||||
{
|
{
|
||||||
_nameProvider = nameProvider;
|
_nameProvider = nameProvider;
|
||||||
|
@ -158,6 +155,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
_currSegment = null;
|
_currSegment = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="Exception">worker thrread died</exception>
|
||||||
public void AddFrame(IVideoProvider source)
|
public void AddFrame(IVideoProvider source)
|
||||||
{
|
{
|
||||||
while (!threadQ.TryAdd(new VideoCopy(source), 1000))
|
while (!threadQ.TryAdd(new VideoCopy(source), 1000))
|
||||||
|
@ -181,6 +179,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
_currSegment.AddFrame(source);
|
_currSegment.AddFrame(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="Exception">worker thrread died</exception>
|
||||||
public void AddSamples(short[] samples)
|
public void AddSamples(short[] samples)
|
||||||
{
|
{
|
||||||
// as MainForm.cs is written now, samples is all ours (nothing else will use it for anything)
|
// as MainForm.cs is written now, samples is all ours (nothing else will use it for anything)
|
||||||
|
@ -316,6 +315,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public bool has_audio;
|
public bool has_audio;
|
||||||
public int a_samplerate, a_channels, a_bits;
|
public int a_samplerate, a_channels, a_bits;
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException"><see cref="a_bits"/> is not <c>8</c> or <c>16</c>, or <see cref="a_channels"/> is not in range <c>1..2</c></exception>
|
||||||
public void PopulateWAVEFORMATEX(ref AVIWriterImports.WAVEFORMATEX wfex)
|
public void PopulateWAVEFORMATEX(ref AVIWriterImports.WAVEFORMATEX wfex)
|
||||||
{
|
{
|
||||||
const int WAVE_FORMAT_PCM = 1;
|
const int WAVE_FORMAT_PCM = 1;
|
||||||
|
@ -640,6 +641,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
Parameters parameters;
|
Parameters parameters;
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">unmanaged call failed</exception>
|
||||||
public void OpenFile(string destPath, Parameters parameters, CodecToken videoCodecToken)
|
public void OpenFile(string destPath, Parameters parameters, CodecToken videoCodecToken)
|
||||||
{
|
{
|
||||||
static int mmioFOURCC(string str) => (
|
static int mmioFOURCC(string str) => (
|
||||||
|
@ -700,9 +703,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>acquires a video codec configuration from the user</summary>
|
||||||
/// Acquires a video codec configuration from the user
|
/// <exception cref="InvalidOperationException">no file open (need to call <see cref="OpenFile"/>)</exception>
|
||||||
/// </summary>
|
|
||||||
public IDisposable AcquireVideoCodecToken(IntPtr hwnd, CodecToken lastCodecToken)
|
public IDisposable AcquireVideoCodecToken(IntPtr hwnd, CodecToken lastCodecToken)
|
||||||
{
|
{
|
||||||
if (!IsOpen)
|
if (!IsOpen)
|
||||||
|
@ -741,9 +743,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>begin recording</summary>
|
||||||
/// begin recording
|
/// <exception cref="InvalidOperationException">no video codec token set (need to call <see cref="OpenFile"/>), or unmanaged call failed</exception>
|
||||||
/// </summary>
|
|
||||||
public void OpenStreams()
|
public void OpenStreams()
|
||||||
{
|
{
|
||||||
if (currVideoCodecToken == null)
|
if (currVideoCodecToken == null)
|
||||||
|
@ -882,6 +883,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
outStatus.audio_buffered_shorts = 0;
|
outStatus.audio_buffered_shorts = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">attempted frame resize during encoding</exception>
|
||||||
public unsafe void AddFrame(IVideoProvider source)
|
public unsafe void AddFrame(IVideoProvider source)
|
||||||
{
|
{
|
||||||
const int AVIIF_KEYFRAME = 0x00000010;
|
const int AVIIF_KEYFRAME = 0x00000010;
|
||||||
|
@ -965,6 +967,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="Exception">no default codec token in config</exception>
|
||||||
public void SetDefaultVideoCodecToken()
|
public void SetDefaultVideoCodecToken()
|
||||||
{
|
{
|
||||||
CodecToken ct = CodecToken.DeSerialize(Global.Config.AVICodecToken);
|
CodecToken ct = CodecToken.DeSerialize(Global.Config.AVICodecToken);
|
||||||
|
|
|
@ -174,7 +174,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return s.ToString();
|
return s.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="Exception">FFmpeg call failed</exception>
|
||||||
public void AddFrame(IVideoProvider source)
|
public void AddFrame(IVideoProvider source)
|
||||||
{
|
{
|
||||||
if (source.BufferWidth != width || source.BufferHeight != height)
|
if (source.BufferWidth != width || source.BufferHeight != height)
|
||||||
|
@ -207,6 +207,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return FFmpegWriterForm.DoFFmpegWriterDlg(hwnd);
|
return FFmpegWriterForm.DoFFmpegWriterDlg(hwnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="ArgumentException"><paramref name="token"/> does not inherit <see cref="FFmpegWriterForm.FormatPreset"/></exception>
|
||||||
public void SetVideoCodecToken(IDisposable token)
|
public void SetVideoCodecToken(IDisposable token)
|
||||||
{
|
{
|
||||||
if (token is FFmpegWriterForm.FormatPreset)
|
if (token is FFmpegWriterForm.FormatPreset)
|
||||||
|
@ -261,6 +262,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="Exception">FFmpeg call failed</exception>
|
||||||
public void AddSamples(short[] samples)
|
public void AddSamples(short[] samples)
|
||||||
{
|
{
|
||||||
if (_ffmpeg.HasExited)
|
if (_ffmpeg.HasExited)
|
||||||
|
@ -285,6 +287,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="ArgumentOutOfRangeException"><paramref name="bits"/> is not <c>16</c></exception>
|
||||||
public void SetAudioParameters(int sampleRate, int channels, int bits)
|
public void SetAudioParameters(int sampleRate, int channels, int bits)
|
||||||
{
|
{
|
||||||
if (bits != 16)
|
if (bits != 16)
|
||||||
|
|
|
@ -82,6 +82,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private GifToken _token;
|
private GifToken _token;
|
||||||
|
|
||||||
|
/// <exception cref="ArgumentException"><paramref name="token"/> does not inherit <see cref="GifWriter.GifToken"/></exception>
|
||||||
public void SetVideoCodecToken(IDisposable token)
|
public void SetVideoCodecToken(IDisposable token)
|
||||||
{
|
{
|
||||||
if (token is GifToken gifToken)
|
if (token is GifToken gifToken)
|
||||||
|
|
|
@ -178,6 +178,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// underlying bytestream that is being written to
|
/// underlying bytestream that is being written to
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Stream f;
|
Stream f;
|
||||||
|
|
||||||
|
/// <exception cref="ArgumentException"><paramref name="f"/> cannot be written to</exception>
|
||||||
public JMDfile(Stream f, int fpsnum, int fpsden, int audiosamplerate, bool stereo)
|
public JMDfile(Stream f, int fpsnum, int fpsden, int audiosamplerate, bool stereo)
|
||||||
{
|
{
|
||||||
if (!f.CanWrite)
|
if (!f.CanWrite)
|
||||||
|
@ -535,9 +537,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// we have no unmanaged resources
|
// we have no unmanaged resources
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>sets the codec token to be used for video compression</summary>
|
||||||
/// sets the codec token to be used for video compression
|
/// <exception cref="ArgumentException"><paramref name="token"/> does not inherit <see cref="JMDWriter.CodecToken"/></exception>
|
||||||
/// </summary>
|
|
||||||
public void SetVideoCodecToken(IDisposable token)
|
public void SetVideoCodecToken(IDisposable token)
|
||||||
{
|
{
|
||||||
if (token is CodecToken)
|
if (token is CodecToken)
|
||||||
|
@ -589,9 +590,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// each frame is dumped independently with its own resolution tag, so we don't care to store this
|
// each frame is dumped independently with its own resolution tag, so we don't care to store this
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>set audio parameters, cannot change later</summary>
|
||||||
/// set audio parameters. cannot change later
|
/// <exception cref="ArgumentException"><paramref name="sampleRate"/> is outside range <c>8000..96000</c>, <paramref name="channels"/> is outside range <c>1..2</c>, or <paramref name="bits"/> is not <c>16</c></exception>
|
||||||
/// </summary>
|
|
||||||
public void SetAudioParameters(int sampleRate, int channels, int bits)
|
public void SetAudioParameters(int sampleRate, int channels, int bits)
|
||||||
{
|
{
|
||||||
// the sampleRate limits are arbitrary, just to catch things which are probably silly-wrong
|
// the sampleRate limits are arbitrary, just to catch things which are probably silly-wrong
|
||||||
|
|
|
@ -66,6 +66,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return GetBufferInternal(length, zerofill, a => a.Length >= length && a.Length / (float)length <= 2.0f);
|
return GetBufferInternal(length, zerofill, a => a.Length >= length && a.Length / (float)length <= 2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="ArgumentException"><paramref name="buffer"/> is not in use</exception>
|
||||||
public void ReleaseBuffer(T[] buffer)
|
public void ReleaseBuffer(T[] buffer)
|
||||||
{
|
{
|
||||||
if (!_inuse.Remove(buffer))
|
if (!_inuse.Remove(buffer))
|
||||||
|
@ -580,16 +581,16 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>write a video frame to the stream</summary>
|
||||||
/// write a video frame to the stream
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="data">raw video data; if length 0, write EOR</param>
|
/// <param name="data">raw video data; if length 0, write EOR</param>
|
||||||
|
/// <exception cref="Exception">internal error, possible A/V desync</exception>
|
||||||
|
/// <exception cref="InvalidOperationException">already written EOR</exception>
|
||||||
public void WriteVideoFrame(int[] video)
|
public void WriteVideoFrame(int[] video)
|
||||||
{
|
{
|
||||||
if (videodone)
|
if (videodone)
|
||||||
throw new InvalidOperationException("Can't write data after end of relevance!");
|
throw new InvalidOperationException("Can't write data after end of relevance!");
|
||||||
if (audioqueue.Count > 5)
|
if (audioqueue.Count > 5)
|
||||||
throw new Exception("A\\V Desync?");
|
throw new Exception("A/V Desync?");
|
||||||
int datalen = video.Length * sizeof(int);
|
int datalen = video.Length * sizeof(int);
|
||||||
byte[] data = _bufferpool.GetBufferAtLeast(datalen);
|
byte[] data = _bufferpool.GetBufferAtLeast(datalen);
|
||||||
Buffer.BlockCopy(video, 0, data, 0, datalen);
|
Buffer.BlockCopy(video, 0, data, 0, datalen);
|
||||||
|
@ -603,16 +604,16 @@ namespace BizHawk.Client.EmuHawk
|
||||||
audioqueue.Dequeue().WriteData(output);
|
audioqueue.Dequeue().WriteData(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>write an audio frame to the stream</summary>
|
||||||
/// write an audio frame to the stream
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="data">raw audio data; if length 0, write EOR</param>
|
/// <param name="data">raw audio data; if length 0, write EOR</param>
|
||||||
|
/// <exception cref="Exception">internal error, possible A/V desync</exception>
|
||||||
|
/// <exception cref="InvalidOperationException">already written EOR</exception>
|
||||||
public void WriteAudioFrame(short[] samples)
|
public void WriteAudioFrame(short[] samples)
|
||||||
{
|
{
|
||||||
if (audiodone)
|
if (audiodone)
|
||||||
throw new Exception("Can't write audio after end of relevance!");
|
throw new Exception("Can't write audio after end of relevance!");
|
||||||
if (videoqueue.Count > 5)
|
if (videoqueue.Count > 5)
|
||||||
throw new Exception("A\\V Desync?");
|
throw new Exception("A/V Desync?");
|
||||||
int datalen = samples.Length * sizeof(short);
|
int datalen = samples.Length * sizeof(short);
|
||||||
byte[] data = _bufferpool.GetBufferAtLeast(datalen);
|
byte[] data = _bufferpool.GetBufferAtLeast(datalen);
|
||||||
Buffer.BlockCopy(samples, 0, data, 0, datalen);
|
Buffer.BlockCopy(samples, 0, data, 0, datalen);
|
||||||
|
|
|
@ -108,6 +108,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="ArgumentOutOfRangeException"><paramref name="bits"/> is not <c>16</c></exception>
|
||||||
public void SetAudioParameters(int sampleRate, int channels, int bits)
|
public void SetAudioParameters(int sampleRate, int channels, int bits)
|
||||||
{
|
{
|
||||||
if (bits != 16)
|
if (bits != 16)
|
||||||
|
|
|
@ -38,17 +38,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private int _maxColors;
|
private int _maxColors;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Construct the octree quantizer
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// The Octree quantizer is a two pass algorithm. The initial pass sets up the octree,
|
|
||||||
/// the second pass quantizes a color based on the nodes in the tree
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="maxColors">The maximum number of colors to return</param>
|
/// <param name="maxColors">The maximum number of colors to return</param>
|
||||||
/// <param name="maxColorBits">The number of significant bits</param>
|
/// <param name="maxColorBits">The number of significant bits</param>
|
||||||
public OctreeQuantizer(int maxColors, int maxColorBits)
|
/// <exception cref="ArgumentOutOfRangeException"><paramref name="maxColors"/> ≥ <c>256</c> or <paramref name="maxColorBits"/> outside range <c>1..8</c></exception>
|
||||||
: base(false)
|
/// <remarks>The Octree quantizer is a two pass algorithm. The initial pass sets up the octree, the second pass quantizes a color based on the nodes in the tree.</remarks>
|
||||||
|
public OctreeQuantizer(int maxColors, int maxColorBits) : base(false)
|
||||||
{
|
{
|
||||||
if (maxColors > 255)
|
if (maxColors > 255)
|
||||||
throw new ArgumentOutOfRangeException(nameof(maxColors), maxColors, "The number of colors should be less than 256");
|
throw new ArgumentOutOfRangeException(nameof(maxColors), maxColors, "The number of colors should be less than 256");
|
||||||
|
|
|
@ -184,6 +184,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// <param name="ss">WavWriter now owns any of these streams that it enumerates</param>
|
/// <param name="ss">WavWriter now owns any of these streams that it enumerates</param>
|
||||||
/// <param name="samplerate">sampling rate in HZ</param>
|
/// <param name="samplerate">sampling rate in HZ</param>
|
||||||
/// <param name="numchannels">number of audio channels</param>
|
/// <param name="numchannels">number of audio channels</param>
|
||||||
|
/// <exception cref="ArgumentException"><paramref name="ss"/> cannot be progressed</exception>
|
||||||
public WavWriter(IEnumerator<Stream> ss, int samplerate, int numchannels)
|
public WavWriter(IEnumerator<Stream> ss, int samplerate, int numchannels)
|
||||||
{
|
{
|
||||||
this.samplerate = samplerate;
|
this.samplerate = samplerate;
|
||||||
|
@ -228,6 +229,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return new WavWriterVToken();
|
return new WavWriterVToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="ArgumentOutOfRangeException"><paramref name="bits"/> is not <c>16</c></exception>
|
||||||
public void SetAudioParameters(int sampleRate, int channels, int bits)
|
public void SetAudioParameters(int sampleRate, int channels, int bits)
|
||||||
{
|
{
|
||||||
this.sampleRate = sampleRate;
|
this.sampleRate = sampleRate;
|
||||||
|
|
|
@ -35,6 +35,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public string URL_post = null;
|
public string URL_post = null;
|
||||||
public bool? audiosync = null;
|
public bool? audiosync = null;
|
||||||
|
|
||||||
|
/// <exception cref="ArgParserException"><c>--socket_ip</c> passed without specifying <c>--socket_port</c> or vice-versa</exception>
|
||||||
public void ParseArguments(string[] args)
|
public void ParseArguments(string[] args)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < args.Length; i++)
|
for (int i = 0; i < args.Length; i++)
|
||||||
|
|
|
@ -52,23 +52,15 @@ namespace BizHawk.Client.EmuHawk.CustomControls
|
||||||
messageLbl.MaximumSize = new Size(MaximumSize.Width - _msgIcon.Width - UIHelper.ScaleX(25), MaximumSize.Height);
|
messageLbl.MaximumSize = new Size(MaximumSize.Width - _msgIcon.Width - UIHelper.ScaleX(25), MaximumSize.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Create up to 3 buttons with given DialogResult values.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="names">Array of button names. Must of length 1-3.</param>
|
|
||||||
/// <param name="results">Array of DialogResult values. Must be same length as names.</param>
|
|
||||||
public void SetButtons(string[] names, DialogResult[] results)
|
|
||||||
{
|
|
||||||
SetButtons(names, results, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create up to 3 buttons with given DialogResult values.
|
/// Create up to 3 buttons with given DialogResult values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="names">Array of button names. Must of length 1-3.</param>
|
/// <param name="names">Array of button names. Must of length 1-3.</param>
|
||||||
/// <param name="results">Array of DialogResult values. Must be same length as names.</param>
|
/// <param name="results">Array of DialogResult values. Must be same length as names.</param>
|
||||||
/// <param name="def">Default Button number. Must be 1-3.</param>
|
/// <param name="def">Default Button number. Must be 1-3.</param>
|
||||||
public void SetButtons(string[] names, DialogResult[] results, int def)
|
/// <exception cref="ArgumentException">length of <paramref name="names"/> is not in range <c>1..3</c></exception>
|
||||||
|
/// <exception cref="ArgumentNullException"><paramref name="names"/> is null</exception>
|
||||||
|
public void SetButtons(string[] names, DialogResult[] results, int def = 1)
|
||||||
{
|
{
|
||||||
if (names == null)
|
if (names == null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -483,8 +483,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public int BufferHeight { get; set; }
|
public int BufferHeight { get; set; }
|
||||||
public int BackgroundColor { get; set; }
|
public int BackgroundColor { get; set; }
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">always</exception>
|
||||||
public int VsyncNumerator => throw new InvalidOperationException();
|
public int VsyncNumerator => throw new InvalidOperationException();
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">always</exception>
|
||||||
public int VsyncDenominator => throw new InvalidOperationException();
|
public int VsyncDenominator => throw new InvalidOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -968,9 +970,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>locks the lua surface called <paramref name="name"/></summary>
|
||||||
/// Locks the requested lua surface name
|
/// <exception cref="InvalidOperationException">already locked, or unknown surface</exception>
|
||||||
/// </summary>
|
|
||||||
public DisplaySurface LockLuaSurface(string name, bool clear=true)
|
public DisplaySurface LockLuaSurface(string name, bool clear=true)
|
||||||
{
|
{
|
||||||
if (MapNameToLuaSurface.ContainsKey(name))
|
if (MapNameToLuaSurface.ContainsKey(name))
|
||||||
|
@ -1037,9 +1038,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>unlocks this DisplaySurface which had better have been locked as a lua surface</summary>
|
||||||
/// Unlocks this DisplaySurface which had better have been locked as a lua surface
|
/// <exception cref="InvalidOperationException">already unlocked</exception>
|
||||||
/// </summary>
|
|
||||||
public void UnlockLuaSurface(DisplaySurface surface)
|
public void UnlockLuaSurface(DisplaySurface surface)
|
||||||
{
|
{
|
||||||
if (!MapLuaSurfaceToName.ContainsKey(surface))
|
if (!MapLuaSurfaceToName.ContainsKey(surface))
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace BizHawk.Client.EmuHawk.WinFormExtensions
|
||||||
{
|
{
|
||||||
public static class ControlExtensions
|
public static class ControlExtensions
|
||||||
{
|
{
|
||||||
|
/// <exception cref="ArgumentException"><typeparamref name="T"/> does not inherit <see cref="Enum"/></exception>
|
||||||
public static void PopulateFromEnum<T>(this ComboBox box, object enumVal)
|
public static void PopulateFromEnum<T>(this ComboBox box, object enumVal)
|
||||||
where T : struct, IConvertible
|
where T : struct, IConvertible
|
||||||
{
|
{
|
||||||
|
@ -213,6 +214,7 @@ namespace BizHawk.Client.EmuHawk.WinFormExtensions
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="Win32Exception">unmanaged call failed</exception>
|
||||||
public static void SetSortIcon(this ListView listViewControl, int columnIndex, SortOrder order)
|
public static void SetSortIcon(this ListView listViewControl, int columnIndex, SortOrder order)
|
||||||
{
|
{
|
||||||
const int LVM_GETHEADER = 4127;
|
const int LVM_GETHEADER = 4127;
|
||||||
|
|
|
@ -20,6 +20,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public static GLManager Instance { get; private set; }
|
public static GLManager Instance { get; private set; }
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">instance already created</exception>
|
||||||
public static void CreateInstance()
|
public static void CreateInstance()
|
||||||
{
|
{
|
||||||
if (Instance != null)
|
if (Instance != null)
|
||||||
|
|
|
@ -2208,6 +2208,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return FormatFilter(items.ToArray());
|
return FormatFilter(items.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="ArgumentException"><paramref name="args"/> contains unpaired element</exception>
|
||||||
public static string FormatFilter(params string[] args)
|
public static string FormatFilter(params string[] args)
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
|
|
|
@ -58,6 +58,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
BaseSoundProvider.DiscardSamples();
|
BaseSoundProvider.DiscardSamples();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException"><see cref="BaseSoundProvider"/>.<see cref="ISoundProvider.SyncMode"/> is not <see cref="SyncSoundMode.Async"/></exception>
|
||||||
public void GetSamplesAsync(short[] samples)
|
public void GetSamplesAsync(short[] samples)
|
||||||
{
|
{
|
||||||
int samplesToGenerate = SamplesInOneFrame;
|
int samplesToGenerate = SamplesInOneFrame;
|
||||||
|
@ -97,6 +98,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
get { return SyncSoundMode.Async; }
|
get { return SyncSoundMode.Async; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="NotSupportedException"><paramref name="mode"/> is not <see cref="SyncSoundMode.Async"/></exception>
|
||||||
public void SetSyncMode(SyncSoundMode mode)
|
public void SetSyncMode(SyncSoundMode mode)
|
||||||
{
|
{
|
||||||
if (mode != SyncSoundMode.Async)
|
if (mode != SyncSoundMode.Async)
|
||||||
|
@ -105,6 +107,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">always</exception>
|
||||||
public void GetSamplesSync(out short[] samples, out int nsamp)
|
public void GetSamplesSync(out short[] samples, out int nsamp)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("Sync mode is not supported.");
|
throw new InvalidOperationException("Sync mode is not supported.");
|
||||||
|
|
|
@ -63,6 +63,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
ResetBuffer();
|
ResetBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">(from setter) constructed in standalone mode</exception>
|
||||||
public int MaxSamplesDeficit
|
public int MaxSamplesDeficit
|
||||||
{
|
{
|
||||||
get { return _maxSamplesDeficit; }
|
get { return _maxSamplesDeficit; }
|
||||||
|
@ -124,6 +125,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
get { return SampleRate / Global.Emulator.VsyncRate(); }
|
get { return SampleRate / Global.Emulator.VsyncRate(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">not constructed in standalone mode</exception>
|
||||||
public void GetSamples(short[] samples)
|
public void GetSamples(short[] samples)
|
||||||
{
|
{
|
||||||
if (!_standaloneMode) throw new InvalidOperationException();
|
if (!_standaloneMode) throw new InvalidOperationException();
|
||||||
|
@ -132,6 +134,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
GetSamplesFromBuffer(samples, returnSampleCount);
|
GetSamplesFromBuffer(samples, returnSampleCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">constructed in standalone mode</exception>
|
||||||
public void GetSamples(int idealSampleCount, out short[] samples, out int sampleCount)
|
public void GetSamples(int idealSampleCount, out short[] samples, out int sampleCount)
|
||||||
{
|
{
|
||||||
if (_standaloneMode) throw new InvalidOperationException();
|
if (_standaloneMode) throw new InvalidOperationException();
|
||||||
|
|
|
@ -28,6 +28,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
get { return SyncSoundMode.Async; }
|
get { return SyncSoundMode.Async; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="NotSupportedException"><paramref name="mode"/> is not <see cref="SyncSoundMode.Async"/></exception>
|
||||||
public void SetSyncMode(SyncSoundMode mode)
|
public void SetSyncMode(SyncSoundMode mode)
|
||||||
{
|
{
|
||||||
if (mode != SyncSoundMode.Async)
|
if (mode != SyncSoundMode.Async)
|
||||||
|
@ -36,6 +37,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">always</exception>
|
||||||
public void GetSamplesSync(out short[] samples, out int nsamp)
|
public void GetSamplesSync(out short[] samples, out int nsamp)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("Sync mode is not supported.");
|
throw new InvalidOperationException("Sync mode is not supported.");
|
||||||
|
|
|
@ -1302,6 +1302,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="Exception">misformatted colour</exception>
|
||||||
[LuaMethodExample("forms.setproperty( 332, \"Property\", \"Property value\" );")]
|
[LuaMethodExample("forms.setproperty( 332, \"Property\", \"Property value\" );")]
|
||||||
[LuaMethod("setproperty", "Attempts to set the given property of the widget with the given value. Note: not all properties will be able to be represented for the control to accept")]
|
[LuaMethod("setproperty", "Attempts to set the given property of the widget with the given value. Note: not all properties will be able to be represented for the control to accept")]
|
||||||
public void SetProperty(int handle, string property, object value)
|
public void SetProperty(int handle, string property, object value)
|
||||||
|
|
|
@ -255,6 +255,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="ArgumentException">running on Windows host, and unmanaged call failed</exception>
|
||||||
|
/// <exception cref="FileNotFoundException">running on Windows host, and either path is not a regular file or directory</exception>
|
||||||
/// <remarks>Algorithm for Windows taken from https://stackoverflow.com/a/485516/7467292</remarks>
|
/// <remarks>Algorithm for Windows taken from https://stackoverflow.com/a/485516/7467292</remarks>
|
||||||
public static string GetRelativePath(string fromPath, string toPath)
|
public static string GetRelativePath(string fromPath, string toPath)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// ReSharper disable once UnusedMember.Global
|
// ReSharper disable once UnusedMember.Global
|
||||||
public class NesSchema : IVirtualPadSchema
|
public class NesSchema : IVirtualPadSchema
|
||||||
{
|
{
|
||||||
|
/// <exception cref="Exception">found <c>ControllerSNES</c></exception>
|
||||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||||
{
|
{
|
||||||
if (core is NES || core is SubNESHawk)
|
if (core is NES || core is SubNESHawk)
|
||||||
|
|
Loading…
Reference in New Issue