Refactor audio code out of bootanimation_main.

So it can be shared with the iot/ variant I refactored it into the
audioplay.h file. This keeps all of the audio code local, we could hide
the functions and only expose the callback but that would make testing
harder.

Test: Ran a bootanimation.zip with audio.wav on Marlin, works as expected.
Bug: 67051984
Change-Id: Ie31dc5f2cfaad5bb23134ef81be712afa6b3cd6f
diff --git a/cmds/bootanimation/audioplay.h b/cmds/bootanimation/audioplay.h
index 0e5705a..4704a70 100644
--- a/cmds/bootanimation/audioplay.h
+++ b/cmds/bootanimation/audioplay.h
@@ -20,6 +20,8 @@
 
 #include <string.h>
 
+#include "BootAnimation.h"
+
 namespace audioplay {
 
 // Initializes the engine with an example of the type of WAV clip to play.
@@ -32,6 +34,9 @@
 void setPlaying(bool isPlaying);
 void destroy();
 
+// Generates callbacks to integrate the audioplay system with the BootAnimation.
+android::sp<android::BootAnimation::Callbacks> createAnimationCallbacks();
+
 }
 
 #endif // AUDIOPLAY_H_