Construct sequencer for playing back SFX groups

This commit is contained in:
Jack Andersen 2016-10-08 15:39:04 -10:00
parent 7cb7ed73ea
commit 3fd3f3edc5
1 changed files with 6 additions and 0 deletions

View File

@ -264,6 +264,8 @@ struct AppCallback : boo::IApplicationCallback
{ {
printf("<space>: keyon/keyoff, <left/right>: cycle SFX, <up/down>: volume, <Q>: quit\n"); printf("<space>: keyon/keyoff, <left/right>: cycle SFX, <up/down>: volume, <Q>: quit\n");
m_seq = m_engine->seqPlay(m_groupId, 0, nullptr);
std::map<uint16_t, const amuse::SFXGroupIndex::SFXEntry*> sortEntries(index.m_sfxEntries.cbegin(), std::map<uint16_t, const amuse::SFXGroupIndex::SFXEntry*> sortEntries(index.m_sfxEntries.cbegin(),
index.m_sfxEntries.cend()); index.m_sfxEntries.cend());
auto sfxIt = sortEntries.cbegin(); auto sfxIt = sortEntries.cbegin();
@ -316,6 +318,8 @@ struct AppCallback : boo::IApplicationCallback
{ {
m_breakout = false; m_breakout = false;
m_vox.reset(); m_vox.reset();
m_seq->allOff(true);
m_seq.reset();
break; break;
} }
@ -383,6 +387,8 @@ struct AppCallback : boo::IApplicationCallback
switch (charCode) switch (charCode)
{ {
case ' ': case ' ':
if (m_seq)
m_seq->allOff(true);
if (m_vox && m_vox->state() == amuse::VoiceState::Playing) if (m_vox && m_vox->state() == amuse::VoiceState::Playing)
m_vox->keyOff(); m_vox->keyOff();
else if (m_sfxId != -1) else if (m_sfxId != -1)