| 554 | |
| 555 | |
| 556 | void NesInstrument::playNote( NotePlayHandle * n, sampleFrame * workingBuffer ) |
| 557 | { |
| 558 | const fpp_t frames = n->framesLeftForCurrentPeriod(); |
| 559 | const f_cnt_t offset = n->noteOffset(); |
| 560 | |
| 561 | if ( n->totalFramesPlayed() == 0 || n->m_pluginData == NULL ) |
| 562 | { |
| 563 | NesObject * nes = new NesObject( this, Engine::mixer()->processingSampleRate(), n ); |
| 564 | n->m_pluginData = nes; |
| 565 | } |
| 566 | |
| 567 | NesObject * nes = static_cast<NesObject *>( n->m_pluginData ); |
| 568 | |
| 569 | nes->renderOutput( workingBuffer + offset, frames ); |
| 570 | |
| 571 | applyRelease( workingBuffer, n ); |
| 572 | |
| 573 | instrumentTrack()->processAudioBuffer( workingBuffer, frames + offset, n ); |
| 574 | } |
| 575 | |
| 576 | |
| 577 | void NesInstrument::deleteNotePluginData( NotePlayHandle * n ) |
nothing calls this directly
no test coverage detected