or I want to play boom.wav (but not hear endarm.wav)
can I do:
SaberBase::DoEffect(EFFECT_BOOM, 0);
SaberBase::SetLockup(SaberBase::LOCKUP_NONE); // I don't want to "end the lockup", I just want to stop it.
Off(OFF_BLAST);
No need to end the lockup in this case, as Off(OFF_BLAST) will do it for you.
There is also no need to call DoEffect with EFFECT_BOOM as hybrid_font will do that for you.
if (SaberBase::Lockup()) {
SaberBase::DoEndLockup();
SaberBase::SetLockup(SaberBase::LOCKUP_NONE);
}
DoEndLockup() will do { DoEffect(EFFECT_LOCKUP_END, 0); }
EFFECT_LOCKUP_END will trigger SB_EndLockup();
since at that point I am in LOCKUP_ARMED SB_EndLockup() will do:
case SaberBase::LOCKUP_ARMED:
end = &SFX_endarm; // <-- this is exactly what I don't want to hear
break;
I want DoEndLockup() to not trigger a cascade that ends in playing endarm, I just want to stop the current armhum.wav loop (no “graceful” ending with endarm)
Is this possible ?
Is not to play boom.wav, but to play boom.bmp on OLED.
It should be, my detonator does that.
Not sure if OS8 broke this, or if my detonator does something different. I’ll check when I get home.
The DoEffect is in hybrid_font.h, but it is still sent to all things.
however, I don’t think there is any support for “boom.bmp” in the oled code, so you’ll need to write a controller for that. (See the blaster oled controllers for how to do that.)
Your detonator used to play boom.wav & endarm.wav (if endarm.wav exists) simultaneously or almost simultaneously, I can’t tell which one starts playing first. However it has been almost a year since I last played with detonator.h
That is one of the reasons I started writing my own.
Thanks, I found it now.
I can confirm that there isn’t support for it.
Already done. I wrote a DetonatorDisplayController, very similar to BlasterDisplayController.
I didn’t mean that it it doesn’t use “Off(OFF_BLAST);” I meant that it uses “Off()” when the moves the safety switch back. My TD does not have a way to turn off the lockup and leave the hum going.
Yes. (Although I have two of them, the other one sounds similar, but adds C3PO saying “He agrees!”)
That is exactly what I meant when I said that you don’t need to end the lockup.
The question is really if it’s wrong to play endarm.wav when you turn the TD off. I mean, technically we are ending the lockup. And if we don’t send an endarm event, something might end up looping forever.
When I turn “Off();” my TD, I want endarm to play and it is doing that. Turning off and playing endarm is not and has never been the issue.
The issue is playing endarm & boom (at the same time) when doing Off(OFF_BLAST);
boom.wav should play instead of endarm
Maybe my answer is to add a new LockupType in saber_base: LOCKUP_BOOM
and add these in hybrid_font:
void SB_BeginLockup() {
...
case SaberBase::LOCKUP_ARMED:
...
case SaberBase::LOCKUP_BOOM:
break; // Do nothing, just keep doing what LOCKUP_ARMED is already doing
case SaberBase::LOCKUP_AUTOFIRE:
...
void SB_EndLockup() {
Effect *end = nullptr;
switch (SaberBase::Lockup()) {
case SaberBase::LOCKUP_ARMED:
end = &SFX_endarm;
break;
case SaberBase::LOCKUP_BOOM:
end = &SFX_boom;
break;
...
And instead of doing Off(OFF_BLAST);
I do:
SaberBase::SetLockup(SaberBase::LOCKUP_BOOM); // SaberBase::LOCKUP_ARMED: has already been started previously
SaberBase::DoEffect(EFFECT_BOOM, 0);
Off(); // or I could even do "Off(OFF_IDLE);" to make sure the detonator is silent after boom
Finally I understand the idea! I thought you didn’t want to use an “endarm” sounding sound in your TD, but you do and it is in your pwroff.wav
endarm.wav is not intended to be used on the thermal detonator. It only took 9+ months of trying to tweak my code to realize that I was trying to do the wrong thing.