Dev:Adding a Sound notification

From Synfig Studio :: Documentation
Revision as of 15:59, 16 December 2018 by BobSynfig (Talk | contribs) (Page creation)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

WIP

synfig-studio/src/gui/app.h

Declare the sound (Mix_Chunk*) as a static member.

 //The sound effects that will be used
 static Mix_Chunk* gRenderDone;

You could add a bool declare as a static member for an option to play.

bool       App::use_render_done_sound = true;

synfig-studio/src/gui/app.cpp

Initialize the sound (Mix_Chunk*) to NULL. You could find the gRenderDone and add it after.

Mix_Chunk* App::gRenderDone           = NULL;

As well you may add a bool for

bool       App::use_render_done_sound = true;


synfig-studio/src/gui/<yourSource>.cpp

You should add

#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>

Add your sound effect play where it should be (end of an event for example)

//Sound effect - RenderDone (-1 : play on first free channel, 0 : no repeat)
Mix_PlayChannel( -1, App::gRenderDone, 0 );