* @return The sequence ID of the wave buffer.
*/
u16 ndspChnGetWaveBufSeq(int id);
+
+/**
+ * @brief Checks whether a channel is currently paused.
+ * @param id ID of the channel (0..23).
+ * @return Whether the channel is currently paused.
+ */
+bool ndspChnIsPaused(int id);
+
+/**
+ * @brief Sets the pause status of a channel.
+ * @param id ID of the channel (0..23).
+ * @param paused Whether the channel is to be paused (true) or unpaused (false).
+ */
+void ndspChnSetPaused(int id, bool paused);
+
///@}
///@name Configuration
ndspWaveBuf* waveBuf;
u16 wavBufCount, wavBufIdNext;
- bool playing;
+ bool playing, paused;
u8 interpType, iirFilterType;
u16 format;
chn->wavBufIdNext = 0;
chn->wavBufSeq = 0;
chn->playing = false;
+ chn->paused = false;
chn->interpType = 0;
chn->iirFilterType = 0;
chn->format = NDSP_FORMAT_PCM16;
ndspChn[id].format = format;
}
+bool ndspChnIsPaused(int id)
+{
+ return ndspChn[id].paused;
+}
+
+void ndspChnSetPaused(int id, bool paused)
+{
+ ndspChnSt* chn = &ndspChn[id];
+ LightLock_Lock(&chn->lock);
+ chn->paused = paused;
+ chn->flags |= CFLAG_PLAYSTATUS;
+ LightLock_Unlock(&chn->lock);
+}
+
void ndspChnSetInterp(int id, ndspInterpType type)
{
ndspChnSt* chn = &ndspChn[id];
if (flags & CFLAG_PLAYSTATUS)
{
u16 playStatus = st->playStatus &~ 0xFF;
- if (chn->playing)
+ if (chn->playing && !chn->paused)
playStatus |= 1;
st->playStatus = playStatus;
stflags |= 0x10000;