Skip to content

Commit

Permalink
Renamed the universal UserData field to ClientData; Improved document…
Browse files Browse the repository at this point in the history
… indexing (#242)
  • Loading branch information
paul-manias authored May 16, 2024
1 parent b63749d commit e1e5ece
Show file tree
Hide file tree
Showing 50 changed files with 448 additions and 437 deletions.
6 changes: 3 additions & 3 deletions docs/html/modules/classes/audio.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<table class="table"><thead><tr><th class="col-md-1">Name</th><th>Description</th></tr></thead><tbody><tr><th class="col-md-1">SFM::F_BIG_ENDIAN</th><td>Combine this flag with any audio format to declare it as big endian.</td></tr><tr><th class="col-md-1">SFM::S16_BIT_MONO</th><td>16-bit mono signed sample.</td></tr><tr><th class="col-md-1">SFM::S16_BIT_STEREO</th><td>16-bit stereo signed sample.</td></tr><tr><th class="col-md-1">SFM::U8_BIT_MONO</th><td>8-bit mono unsigned sample.</td></tr><tr><th class="col-md-1">SFM::U8_BIT_STEREO</th><td>8-bit stereo unsigned sample.</td></tr></tbody></table>
<p>By default, all samples are assumed to be in little endian format, as supported by Intel CPU's. If the data is in big endian format, logical-or the SampleFormat value with <code>SFM::F_BIG_ENDIAN</code>.</p>
<p>It is also possible to supply loop information with the sample data. This is achieved by configuring the AudioLoop structure:</p>
<table class="table"><thead><tr><th class="col-md-1">Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><th class="col-md-1">LoopMode</th><td>LOOP</td><td>Loop mode (single, double)</td></tr><tr><th class="col-md-1">Loop1Type</th><td>LTYPE</td><td>First loop type (unidirectional, bidirectional)</td></tr><tr><th class="col-md-1">Loop2Type</th><td>LTYPE</td><td>Second loop type (unidirectional, bidirectional)</td></tr><tr><th class="col-md-1">Loop1Start</th><td>LONG</td><td>Start of the first loop</td></tr><tr><th class="col-md-1">Loop1End</th><td>LONG</td><td>End of the first loop</td></tr><tr><th class="col-md-1">Loop2Start</th><td>LONG</td><td>Start of the second loop</td></tr><tr><th class="col-md-1">Loop2End</th><td>LONG</td><td>End of the second loop</td></tr></tbody></table>
<table class="table"><thead><tr><th class="col-md-1">Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><th class="col-md-1">LoopMode</th><td>LOOP</td><td><a data-toggle="tooltip" title="" href="#tf-Loop%20mode%20(single,%20double)">Loop mode (single, double)</a></td></tr><tr><th class="col-md-1">Loop1Type</th><td>LTYPE</td><td><a data-toggle="tooltip" title="" href="#tf-First%20loop%20type%20(unidirectional,%20bidirectional)">First loop type (unidirectional, bidirectional)</a></td></tr><tr><th class="col-md-1">Loop2Type</th><td>LTYPE</td><td><a data-toggle="tooltip" title="" href="#tf-Second%20loop%20type%20(unidirectional,%20bidirectional)">Second loop type (unidirectional, bidirectional)</a></td></tr><tr><th class="col-md-1">Loop1Start</th><td>LONG</td><td><a data-toggle="tooltip" title="" href="#tf-Start%20of%20the%20first%20loop">Start of the first loop</a></td></tr><tr><th class="col-md-1">Loop1End</th><td>LONG</td><td><a data-toggle="tooltip" title="" href="#tf-End%20of%20the%20first%20loop">End of the first loop</a></td></tr><tr><th class="col-md-1">Loop2Start</th><td>LONG</td><td><a data-toggle="tooltip" title="" href="#tf-Start%20of%20the%20second%20loop">Start of the second loop</a></td></tr><tr><th class="col-md-1">Loop2End</th><td>LONG</td><td><a data-toggle="tooltip" title="" href="#tf-End%20of%20the%20second%20loop">End of the second loop</a></td></tr></tbody></table>
<p>The types that can be specified in the LoopMode field are:</p>
<table class="table"><thead><tr><th class="col-md-1">Name</th><th>Description</th></tr></thead><tbody><tr><th class="col-md-1">LOOP::AMIGA</th><td>Single loop: Amiga style.</td></tr><tr><th class="col-md-1">LOOP::AMIGA_NONE</th><td>Amiga loop: Do nothing.</td></tr><tr><th class="col-md-1">LOOP::DOUBLE</th><td>Double loop: When the note is released, playing shifts to the second loop.</td></tr><tr><th class="col-md-1">LOOP::SINGLE</th><td>Single loop: Releasing will end the note.</td></tr><tr><th class="col-md-1">LOOP::SINGLE_RELEASE</th><td>Single loop: Sample data after the loop will be played when the note is released.</td></tr></tbody></table>
<p>The Loop1Type and Loop2Type fields alter the style of the loop. These can be set to the following:</p>
Expand All @@ -86,13 +86,13 @@ <h3>Error Codes</h3><table class="table table-sm borderless"><tbody><tr><th clas
<table class="table"><thead><tr><th class="col-md-1">Name</th><th>Description</th></tr></thead><tbody><tr><th class="col-md-1">SFM::F_BIG_ENDIAN</th><td>Combine this flag with any audio format to declare it as big endian.</td></tr><tr><th class="col-md-1">SFM::S16_BIT_MONO</th><td>16-bit mono signed sample.</td></tr><tr><th class="col-md-1">SFM::S16_BIT_STEREO</th><td>16-bit stereo signed sample.</td></tr><tr><th class="col-md-1">SFM::U8_BIT_MONO</th><td>8-bit mono unsigned sample.</td></tr><tr><th class="col-md-1">SFM::U8_BIT_STEREO</th><td>8-bit stereo unsigned sample.</td></tr></tbody></table>
<p>By default, all samples are assumed to be in little endian format, as supported by Intel CPU's. If the data is in big endian format, logical-or the SampleFormat value with the flag <code>SFM::F_BIG_ENDIAN</code>.</p>
<p>It is also possible to supply loop information with the stream. The Audio class supports a number of different looping formats via the AudioLoop structure:</p>
<table class="table"><thead><tr><th class="col-md-1">Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><th class="col-md-1">LoopMode</th><td>LOOP</td><td>Loop mode (single, double)</td></tr><tr><th class="col-md-1">Loop1Type</th><td>LTYPE</td><td>First loop type (unidirectional, bidirectional)</td></tr><tr><th class="col-md-1">Loop2Type</th><td>LTYPE</td><td>Second loop type (unidirectional, bidirectional)</td></tr><tr><th class="col-md-1">Loop1Start</th><td>LONG</td><td>Start of the first loop</td></tr><tr><th class="col-md-1">Loop1End</th><td>LONG</td><td>End of the first loop</td></tr><tr><th class="col-md-1">Loop2Start</th><td>LONG</td><td>Start of the second loop</td></tr><tr><th class="col-md-1">Loop2End</th><td>LONG</td><td>End of the second loop</td></tr></tbody></table>
<table class="table"><thead><tr><th class="col-md-1">Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><th class="col-md-1">LoopMode</th><td>LOOP</td><td><a data-toggle="tooltip" title="" href="#tf-Loop%20mode%20(single,%20double)">Loop mode (single, double)</a></td></tr><tr><th class="col-md-1">Loop1Type</th><td>LTYPE</td><td><a data-toggle="tooltip" title="" href="#tf-First%20loop%20type%20(unidirectional,%20bidirectional)">First loop type (unidirectional, bidirectional)</a></td></tr><tr><th class="col-md-1">Loop2Type</th><td>LTYPE</td><td><a data-toggle="tooltip" title="" href="#tf-Second%20loop%20type%20(unidirectional,%20bidirectional)">Second loop type (unidirectional, bidirectional)</a></td></tr><tr><th class="col-md-1">Loop1Start</th><td>LONG</td><td><a data-toggle="tooltip" title="" href="#tf-Start%20of%20the%20first%20loop">Start of the first loop</a></td></tr><tr><th class="col-md-1">Loop1End</th><td>LONG</td><td><a data-toggle="tooltip" title="" href="#tf-End%20of%20the%20first%20loop">End of the first loop</a></td></tr><tr><th class="col-md-1">Loop2Start</th><td>LONG</td><td><a data-toggle="tooltip" title="" href="#tf-Start%20of%20the%20second%20loop">Start of the second loop</a></td></tr><tr><th class="col-md-1">Loop2End</th><td>LONG</td><td><a data-toggle="tooltip" title="" href="#tf-End%20of%20the%20second%20loop">End of the second loop</a></td></tr></tbody></table>
<p>There are three types of loop modes that can be specified in the LoopMode field:</p>
<table class="table"><thead><tr><th class="col-md-1">Name</th><th>Description</th></tr></thead><tbody><tr><th class="col-md-1">LOOP::AMIGA</th><td>Single loop: Amiga style.</td></tr><tr><th class="col-md-1">LOOP::AMIGA_NONE</th><td>Amiga loop: Do nothing.</td></tr><tr><th class="col-md-1">LOOP::DOUBLE</th><td>Double loop: When the note is released, playing shifts to the second loop.</td></tr><tr><th class="col-md-1">LOOP::SINGLE</th><td>Single loop: Releasing will end the note.</td></tr><tr><th class="col-md-1">LOOP::SINGLE_RELEASE</th><td>Single loop: Sample data after the loop will be played when the note is released.</td></tr></tbody></table>
<p>The Loop1Type and Loop2Type fields normally determine the style of the loop, however only unidirectional looping is currently supported for streams. For that reason, set the type variables to either <code>LTYPE::NIL</code> or <code>LTYPE::UNIDIRECTIONAL</code>.</p>
<h3>Error Codes</h3><table class="table table-sm borderless"><tbody><tr><th class="col-md-1">Okay</th><td>Operation successful.</td></tr><tr><th class="col-md-1">Args</th><td>Invalid arguments passed to function.</td></tr><tr><th class="col-md-1">AllocMemory</th><td>Failed to allocate the stream buffer.</td></tr><tr><th class="col-md-1">NullArgs</th><td>Function call missing argument value(s)</td></tr></tbody></table></div></div></td></tr><tr data-toggle="collapse" data-target="#fl-Beep" class="clickable"><th class="col-md-1 text-primary">Beep</th><td><a id="tm-Beep"></a>Beeps the PC audio speaker.</td></tr><tr class="no-hover"><td colspan="2" class="hiddenRow"><div id="fl-Beep" class="accordion-body collapse"><div class="panel panel-info" style="border-radius: 0;"><div class="panel-heading" style="border-radius: 0;"><samp>ERR sndBeep(OBJECTPTR Object, LONG Pitch, LONG Duration, LONG Volume)</samp></div><div class="panel-body"><table class="table" style="border: 4px; margin-bottom: 0px; border: 0px; border-bottom: 0px;"><thead><tr><th class="col-md-1">Input</th><th>Description</th></tr></thead><tbody><tr><td>Pitch</td><td>The pitch of the beep in HZ.</td></tr><tr><td>Duration</td><td>The duration of the beep in milliseconds.</td></tr><tr><td>Volume</td><td>The volume of the beep, from 0 to 100.</td></tr></tbody></table></div></div><div class="docs-content" style="margin:30px 20px;">
<p>This method will beep the PC audio speaker, if available. It is possible to request the specific Pitch, Duration and Volume for the sound although not all platforms may support the parameters. In some cases the beep may be converted to a standard warning sound by the host.</p>
<h3>Error Codes</h3><table class="table table-sm borderless"><tbody><tr><th class="col-md-1">Okay</th><td>Operation successful.</td></tr><tr><th class="col-md-1">NoSupport</th><td>PC speaker support is not available.</td></tr><tr><th class="col-md-1">NullArgs</th><td>Function call missing argument value(s)</td></tr></tbody></table></div></div></td></tr><tr data-toggle="collapse" data-target="#fl-CloseChannels" class="clickable"><th class="col-md-1 text-primary">CloseChannels</th><td><a id="tm-CloseChannels"></a>Frees audio channels that have been allocated for sample playback.</td></tr><tr class="no-hover"><td colspan="2" class="hiddenRow"><div id="fl-CloseChannels" class="accordion-body collapse"><div class="panel panel-info" style="border-radius: 0;"><div class="panel-heading" style="border-radius: 0;"><samp>ERR sndCloseChannels(OBJECTPTR Object, LONG Handle)</samp></div><div class="panel-body"><table class="table" style="border: 4px; margin-bottom: 0px; border: 0px; border-bottom: 0px;"><thead><tr><th class="col-md-1">Input</th><th>Description</th></tr></thead><tbody><tr><td>Handle</td><td>Must refer to a channel handle returned from the OpenChannels method.</td></tr></tbody></table></div></div><div class="docs-content" style="margin:30px 20px;">
<h3>Error Codes</h3><table class="table table-sm borderless"><tbody><tr><th class="col-md-1">Okay</th><td>Operation successful.</td></tr><tr><th class="col-md-1">NoSupport</th><td>PC speaker support is not available.</td></tr><tr><th class="col-md-1">NullArgs</th><td>Function call missing argument value(s)</td></tr></tbody></table></div></div></td></tr><tr data-toggle="collapse" data-target="#fl-CloseChannels" class="clickable"><th class="col-md-1 text-primary">CloseChannels</th><td><a id="tm-CloseChannels"></a>Frees audio channels that have been allocated for sample playback.</td></tr><tr class="no-hover"><td colspan="2" class="hiddenRow"><div id="fl-CloseChannels" class="accordion-body collapse"><div class="panel panel-info" style="border-radius: 0;"><div class="panel-heading" style="border-radius: 0;"><samp>ERR sndCloseChannels(OBJECTPTR Object, LONG Handle)</samp></div><div class="panel-body"><table class="table" style="border: 4px; margin-bottom: 0px; border: 0px; border-bottom: 0px;"><thead><tr><th class="col-md-1">Input</th><th>Description</th></tr></thead><tbody><tr><td>Handle</td><td>Must refer to a channel handle returned from the <a data-toggle="tooltip" title="Allocates audio channels that can be used for sample playback." href="#tm-OpenChannels">OpenChannels()</a> method.</td></tr></tbody></table></div></div><div class="docs-content" style="margin:30px 20px;">
<p>Use CloseChannels to destroy a group of channels that have previously been allocated through the <a data-toggle="tooltip" title="Allocates audio channels that can be used for sample playback." href="#tm-OpenChannels">OpenChannels()</a> method. Any audio commands buffered against the channels will be cleared instantly. Any audio data that has already been mixed into the output buffer can continue to play for 1 - 2 seconds. If this is an issue then the volume should be muted at the same time.</p>
<h3>Error Codes</h3><table class="table table-sm borderless"><tbody><tr><th class="col-md-1">Okay</th><td>Operation successful.</td></tr><tr><th class="col-md-1">Args</th><td>Invalid arguments passed to function.</td></tr><tr><th class="col-md-1">NullArgs</th><td>Function call missing argument value(s)</td></tr></tbody></table></div></div></td></tr><tr data-toggle="collapse" data-target="#fl-OpenChannels" class="clickable"><th class="col-md-1 text-primary">OpenChannels</th><td><a id="tm-OpenChannels"></a>Allocates audio channels that can be used for sample playback.</td></tr><tr class="no-hover"><td colspan="2" class="hiddenRow"><div id="fl-OpenChannels" class="accordion-body collapse"><div class="panel panel-info" style="border-radius: 0;"><div class="panel-heading" style="border-radius: 0;"><samp>ERR sndOpenChannels(OBJECTPTR Object, LONG Total, LONG * Result)</samp></div><div class="panel-body"><table class="table" style="border: 4px; margin-bottom: 0px; border: 0px; border-bottom: 0px;"><thead><tr><th class="col-md-1">Input</th><th>Description</th></tr></thead><tbody><tr><td>Total</td><td>Total of channels to allocate.</td></tr><tr><td>Result</td><td>The resulting channel handle is returned in this parameter.</td></tr></tbody></table></div></div><div class="docs-content" style="margin:30px 20px;">
<p>Use the OpenChannels method to open audio channels for sample playback. Channels are allocated in sets with a size range between 1 and 64. Channel sets make it easier to segregate playback between users of the same audio object.</p>
Expand Down
Loading

0 comments on commit e1e5ece

Please sign in to comment.