MCPcopy Create free account
hub / github.com/doldecomp/mkdd / updateDSPChannel

Method updateDSPChannel

libs/JSystem/JAudio/System/JASChannel.cpp:328–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326}
327
328s32 JASChannel::updateDSPChannel(JASDsp::TChannel *dspChannel) {
329#line 429
330 JUT_ASSERT(mStatus == STATUS_PLAY || mStatus == STATUS_RELEASE)
331 JUT_ASSERT(mDspCh);
332 if (mCb) {
333 mCb(CB_PLAY, this, dspChannel, mCbData);
334 }
335
336 if (mWaveData.mInfo._24[0] == 0) {
337#line 441
338 JUT_CRITICAL_WARNING_F("%s", "Lost wave data while playing");
339 mDspCh->free();
340 mDspCh = NULL;
341 delete this;
342 return -1;
343 }
344
345 if (checkBankDispose()) {
346#line 452
347 JUT_CRITICAL_WARNING_F("%s", "Lost bank data while playing");
348 mDspCh->free();
349 mDspCh = NULL;
350 delete this;
351 return -1;
352 }
353
354 dspChannel->setPauseFlag(mPauseFlag);
355
356 if (mPauseFlag) {
357 if (mOscillators[0].isRelease()) {
358 mDspCh->free();
359 mDspCh = NULL;
360 delete this;
361 return -1;
362 }
363 return 0;
364 }
365
366 f32 inc = 32028.5f / JASDriver::getDacRate();
367 mVibrate.incCounter(inc);
368 mTremolo.incCounter(inc);
369 if (mUpdateTimer != 0) {
370 mUpdateTimer--;
371 if (mUpdateTimer == 0 && mCb != NULL) {
372 mCb(CB_TIMER, this, dspChannel, mCbData);
373 }
374 }
375 inc = 48000.0f / JASDriver::getDacRate();
376 JASOscillator::EffectParams effect_params;
377 for (u32 i = 0; i < 2; i++) {
378 if (mOscillators[i].isValid()) {
379 mOscillators[i].incCounter(inc);
380 effectOsc(i, &effect_params);
381 if (i == 0 && mOscillators[i].isStop()) {
382 mDspCh->free();
383 mDspCh = NULL;
384 delete this;
385 return -1;

Callers 1

dspUpdateCallbackMethod · 0.80

Calls 11

getDacRateFunction · 0.85
pow2Function · 0.85
isReleaseMethod · 0.80
isStopMethod · 0.80
setMixerVolumeMethod · 0.80
freeMethod · 0.45
setPauseFlagMethod · 0.45
incCounterMethod · 0.45
isValidMethod · 0.45
getValueMethod · 0.45
setPitchMethod · 0.45

Tested by

no test coverage detected