Hi!
I have created an object called soundclip, it manipulates everything related to AudioEngine,… For instance, a main menu bgm, the main menu bgm is in my case a soundclip that contains an ushort Id which is the returned value from AudioEngine::play2d()…
Until here works fine…
Now I want to create a function that progressively set the sound volume to desired target volume ( fade volume)… I can do this with ActionFloat reducing the volume progressively… Problem is that soundclip class is not an scene and inherits nothing.
I can include cocos2d.h into soundclip source file, that will make me use ActionFloat, but I cannot execute my action with runAction, since this function seems to be in a cocos abstract Scene class…
So my possibilities are:
- make soundclip inherits from cocos2d::Scene
- include Scene cocos class into the soundclip source file.
- do not implement soundclip, just use all my sound interfaces inside the scene class ( probably writing an abstract personalized superclass for all scenes)
- use Actions inside the scene and call set_volume() inside the ActonFloat…
- any other?
Thanks