Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
198 lines
20 KiB
HTML
198 lines
20 KiB
HTML
<!DOCTYPE html>
|
||
|
||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>ndp_player.h</title><link rel="stylesheet" type="text/css" href="../../styles/main.css" /><script type="text/javascript" src="../../styles/main.js"></script><script type="text/javascript">NDLoader.LoadJS("Content", "../../styles/");</script></head>
|
||
|
||
<!-- Generated by Natural Docs, version 2.2 -->
|
||
|
||
<!-- saved from url=(0016)http://localhost -->
|
||
|
||
<body onload="NDLoader.OnLoad('Content');" class="NDPage NDContentPage">
|
||
|
||
<a name="Core"></a><a name="Topic253"></a><div class="CTopic TGroup LC first">
|
||
<div class="CTitle">Core</div>
|
||
</div>
|
||
|
||
<a name="NDP_Initialize"></a><a name="Topic254"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_Initialize</div>
|
||
<div id="NDPrototype254" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> NDP_Initialize()</div></div>
|
||
<div class="CBody"><p>Driver initialization. Must be called first before accessing any other functions</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_SetMusicData"></a><a name="Topic255"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_SetMusicData</div>
|
||
<div id="NDPrototype255" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> NDP_SetMusicData(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PModifierQualifier first"><span class="SHKeyword">const</span> </td><td class="PType"><span class="SHKeyword">void</span>* </td><td class="PName last">addr</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
|
||
<div class="CBody"><p>Song data start address setting</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">addr<div class="CDLParameterType"><span class="SHKeyword">const</span> <span class="SHKeyword">void</span>*</div></td><td class="CDLDefinition"><p>Address of the music data. This should point to a .NDP binary data without the 7 bytes BASIC headers</p></td></tr></table></div>
|
||
</div>
|
||
|
||
<a name="NDP_Play"></a><a name="Topic256"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_Play</div>
|
||
<div id="NDPrototype256" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> NDP_Play()</div></div>
|
||
<div class="CBody"><p>Start playing (clears the work area to zero and starts playing from music start)</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_Stop"></a><a name="Topic257"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_Stop</div>
|
||
<div id="NDPrototype257" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> NDP_Stop()</div></div>
|
||
<div class="CBody"><p>Stops playback</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_Update"></a><a name="Topic258"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_Update</div>
|
||
<div id="NDPrototype258" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> NDP_Update()</div></div>
|
||
<div class="CBody"><p>Update a music frame. Must be called at each graphics frame; ideally from the interrupt code.</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_Release"></a><a name="Topic259"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_Release</div>
|
||
<div id="NDPrototype259" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> NDP_Release()</div></div>
|
||
<div class="CBody"><p>Release the driver. Only needed if you would like to initilize the driver again</p></div>
|
||
</div>
|
||
|
||
<a name="Utility"></a><a name="Topic260"></a><div class="CTopic TGroup LC">
|
||
<div class="CTitle">Utility</div>
|
||
</div>
|
||
|
||
<a name="NDP_MuteChannel1"></a><a name="Topic261"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_MuteChannel1</div>
|
||
<div class="CBody"><p>Temporary mute channel A</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">frames</td><td class="CDLDefinition"><p>Number of frames to mute (1:Cancel, 2 to 254:Duraton, 255:Permanent)</p></td></tr></table></div>
|
||
</div>
|
||
|
||
<a name="NDP_MuteChannel2"></a><a name="Topic262"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_MuteChannel2</div>
|
||
<div class="CBody"><p>Temporary mute channel B</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">frames</td><td class="CDLDefinition"><p>Number of frames to mute (1:Cancel, 2 to 254:Duraton, 255:Permanent)</p></td></tr></table></div>
|
||
</div>
|
||
|
||
<a name="NDP_MuteChannel3"></a><a name="Topic263"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_MuteChannel3</div>
|
||
<div class="CBody"><p>Temporary mute channel C</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">frames</td><td class="CDLDefinition"><p>Number of frames to mute (1:Cancel, 2 to 254:Duraton, 255:Permanent)</p></td></tr></table></div>
|
||
</div>
|
||
|
||
<a name="NDP_MuteChannel"></a><a name="Topic264"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_MuteChannel</div>
|
||
<div id="NDPrototype264" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> NDP_MuteChannel(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8 </td><td class="PName last">channel,</td></tr><tr><td class="PType first">u8 </td><td class="PName last">frames</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
|
||
<div class="CBody"><p>Temporary mute the given channel</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">channel<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Channel number</p></td></tr></table><pre class="CText">NDP_CHANNEL_A<br />NDP_CHANNEL_B<br />NDP_CHANNEL_C</pre><p>frames - Number of frames to mute (1:Cancel, 2 to 254:Duraton, 255:Permanent)</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_SetVolume"></a><a name="Topic265"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_SetVolume</div>
|
||
<div id="NDPrototype265" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> NDP_SetVolume(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8 </td><td class="PName last">vol</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
|
||
<div class="CBody"><p>Set master volume</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">vol<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>New master volume</p></td></tr></table></div>
|
||
</div>
|
||
|
||
<a name="NDP_FadeOut"></a><a name="Topic266"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_FadeOut</div>
|
||
<div id="NDPrototype266" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> NDP_FadeOut(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8 </td><td class="PName last">speed</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
|
||
<div class="CBody"><p>Start fade-out current music</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">speed<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Number of frames for each stage (the small the quicker)</p></td></tr></table></div>
|
||
</div>
|
||
|
||
<a name="NDP_PlayFadeIn"></a><a name="Topic267"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_PlayFadeIn</div>
|
||
<div id="NDPrototype267" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> NDP_PlayFadeIn(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8 </td><td class="PName last">speed</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
|
||
<div class="CBody"><p>Starts playing music while fading-in</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">speed<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Number of frames for each stage (the small the quicker)</p></td></tr></table></div>
|
||
</div>
|
||
|
||
<a name="NDP_SetToneColor"></a><a name="Topic268"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_SetToneColor</div>
|
||
<div id="NDPrototype268" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> NDP_SetToneColor(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PModifierQualifier first"><span class="SHKeyword">const</span> </td><td class="PType"><span class="SHKeyword">void</span>* </td><td class="PName last">addr</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
|
||
<div class="CBody"><p>Set tone color data</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">addr<div class="CDLParameterType"><span class="SHKeyword">const</span> <span class="SHKeyword">void</span>*</div></td><td class="CDLDefinition"><p>Address of tone color definition table</p></td></tr></table></div>
|
||
</div>
|
||
|
||
<a name="NDP_GetVersion"></a><a name="Topic269"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_GetVersion</div>
|
||
<div id="NDPrototype269" class="NDPrototype"><div class="PSection PPlainSection">u16 NDP_GetVersion()</div></div>
|
||
<div class="CBody"><p>Driver version number</p><div class="CHeading">Return</div><p>NDP driver version (for example, 0x0104 is version 1.0.4)</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_SetInitFlag"></a><a name="Topic270"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_SetInitFlag</div>
|
||
<div id="NDPrototype270" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> NDP_SetInitFlag(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8 </td><td class="PName last">flag</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
|
||
<div class="CBody"><p>Set initialization flag</p></div>
|
||
</div>
|
||
|
||
<a name="SFX"></a><a name="Topic271"></a><div class="CTopic TGroup LC">
|
||
<div class="CTitle">SFX</div>
|
||
</div>
|
||
|
||
<a name="NDP_SetSFXData"></a><a name="Topic272"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_SetSFXData</div>
|
||
<div id="NDPrototype272" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> NDP_SetSFXData(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PModifierQualifier first"><span class="SHKeyword">const</span> </td><td class="PType"><span class="SHKeyword">void</span>* </td><td class="PName last">addr</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
|
||
<div class="CBody"><p>Set sound effects data address</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">addr<div class="CDLParameterType"><span class="SHKeyword">const</span> <span class="SHKeyword">void</span>*</div></td><td class="CDLDefinition"><p>Address of the sound effects data. This should point to a .NDS binary data without the 7 bytes BASIC headers</p></td></tr></table></div>
|
||
</div>
|
||
|
||
<a name="NDP_GetSFXNumber"></a><a name="Topic273"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_GetSFXNumber</div>
|
||
<div id="NDPrototype273" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> u8 NDP_GetSFXNumber()</div></div>
|
||
<div class="CBody"><p>Get the number of sound effect into the current bank. <a href="../../index.html#File:ndp/ndp_player.h:NDP_SetSFXData" target="_top" onmouseover="NDContentPage.OnLinkMouseOver(event,272);" onmouseout="NDContentPage.OnLinkMouseOut(event);" >NDP_SetSFXData</a> must be called first</p><div class="CHeading">Return</div><p>Number of sound effect in the current bank</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_GetSFXOffset"></a><a name="Topic274"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_GetSFXOffset</div>
|
||
<div id="NDPrototype274" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> u16 NDP_GetSFXOffset(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8 </td><td class="PName last">sfx</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
|
||
<div class="CBody"><p>Get the offset of a given sound effect into the current bank. <a href="../../index.html#File:ndp/ndp_player.h:NDP_SetSFXData" target="_top" onmouseover="NDContentPage.OnLinkMouseOver(event,272);" onmouseout="NDContentPage.OnLinkMouseOut(event);" >NDP_SetSFXData</a> must be called first</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">sfx<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Index of the sound effect</p></td></tr></table><div class="CHeading">Return</div><p>Offset of the given sound effect from the start of the bank data</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_PlaySFX"></a><a name="Topic275"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_PlaySFX</div>
|
||
<div id="NDPrototype275" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> NDP_PlaySFX(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8 </td><td class="PName last">sfx</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
|
||
<div class="CBody"><p>Play a given sound effect. <a href="../../index.html#File:ndp/ndp_player.h:NDP_SetSFXData" target="_top" onmouseover="NDContentPage.OnLinkMouseOver(event,272);" onmouseout="NDContentPage.OnLinkMouseOut(event);" >NDP_SetSFXData</a> must be called first</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">sfx<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Index of the sound effect to playback</p></td></tr></table></div>
|
||
</div>
|
||
|
||
<a name="Status"></a><a name="Topic276"></a><div class="CTopic TGroup LC">
|
||
<div class="CTitle">Status</div>
|
||
</div>
|
||
|
||
<a name="NDP_GetStatus"></a><a name="Topic277"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_GetStatus</div>
|
||
<div id="NDPrototype277" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> u8 NDP_GetStatus()</div></div>
|
||
<div class="CBody"><p>Playing status (NDP_STATUS_xxx)</p><div class="CHeading">Return</div><pre class="CText">NDP_STATUS_STOPPED<br />NDP_STATUS_PLAYING</pre></div>
|
||
</div>
|
||
|
||
<a name="NDP_IsPlaying"></a><a name="Topic278"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_IsPlaying</div>
|
||
<div id="NDPrototype278" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> NDP_IsPlaying()</div></div>
|
||
<div class="CBody"><p>Whether or not music is currently playing</p><div class="CHeading">Return</div><p>FALSE if music is not playing</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_IsStopped"></a><a name="Topic279"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_IsStopped</div>
|
||
<div id="NDPrototype279" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> NDP_IsStopped()</div></div>
|
||
<div class="CBody"><p>Whether or not music is currently stopped</p><div class="CHeading">Return</div><p>FALSE if music is not stopped</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_HasTrackEnded"></a><a name="Topic280"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_HasTrackEnded</div>
|
||
<div id="NDPrototype280" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> NDP_HasTrackEnded(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8 </td><td class="PName last">track</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
|
||
<div class="CBody"><p>Whether or not each track has reached the end</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">track<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>ID of the track</p></td></tr></table><pre class="CText">NDP_TRACK_1<br />NDP_TRACK_2<br />NDP_TRACK_3<br />NDP_TRACK_RYTHM<br />NDP_TRACK_ALL</pre><div class="CHeading">Return</div><p>FALSE if the given track hasn't reached its end</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_HasMusicEnded"></a><a name="Topic281"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_HasMusicEnded</div>
|
||
<div id="NDPrototype281" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> NDP_HasMusicEnded()</div></div>
|
||
<div class="CBody"><p>Whether or not all tracks have reached the end</p><div class="CHeading">Return</div><p>FALSE if the music hasn't reached the end</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_GetLoopCount"></a><a name="Topic282"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_GetLoopCount</div>
|
||
<div id="NDPrototype282" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> u8 NDP_GetLoopCount()</div></div>
|
||
<div class="CBody"><p>Number of times the music has looped</p><div class="CHeading">Return</div><p>If the music does not have an infinite loop, check +0BH in the music data and return 255 when the music finishes playing</p></div>
|
||
</div>
|
||
|
||
<a name="NDP_IsFadding"></a><a name="Topic283"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_IsFadding</div>
|
||
<div id="NDPrototype283" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> u8 NDP_IsFadding()</div></div>
|
||
<div class="CBody"><p>Fade setting</p><div class="CHeading">Return</div><pre class="CText">0: No fade<br />1–255: Fade count</pre></div>
|
||
</div>
|
||
|
||
<a name="NDP_GetFadeType"></a><a name="Topic284"></a><div class="CTopic TFunction LC">
|
||
<div class="CTitle">NDP_GetFadeType</div>
|
||
<div id="NDPrototype284" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> u8 NDP_GetFadeType()</div></div>
|
||
<div class="CBody"><p>Get th fade type</p><div class="CHeading">Return</div><pre class="CText">NDP_FADE_OUT<br />NDP_FADE_IN</pre></div>
|
||
</div>
|
||
|
||
<a name="NDP_IsInitialized"></a><a name="Topic285"></a><div class="CTopic TFunction LC last">
|
||
<div class="CTitle">NDP_IsInitialized</div>
|
||
<div id="NDPrototype285" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> NDP_IsInitialized()</div></div>
|
||
<div class="CBody"><p>Is the driver initialized</p><div class="CHeading">Return</div><p>FALSE if driver not initialized</p></div>
|
||
</div>
|
||
|
||
</body></html> |