News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Playing a sound when compilation has finished/failed

Started by 4ian, February 22, 2010, 05:27:45 PM

Previous topic - Next topic

4ian

Hello,

I'm looking for a way to get Code::Blocks to play a sound when compilation has finished or has failed.
Sometimes, compilation process can take a while, and having a sound played when the process is finished could help. ( For instance, I often do something else, as go on internet ).
Do you know if there is any way to do this currently ? Maybe it could be a good idea to add such an ( optional ) feature to Code::Blocks ( using wxSound for example ).
4ian

Game Develop : Free game development software

killerbot

first thing that comes to mind : post build step that launches your favorite mp3 player software and you give the mp3 to play as a command line argument to the player

4ian

I've tried to add : "Execute("MyProgram.exe");" to post-build steps, but it does not seems to work. ( Post build steps aren't Squirrel scripts maybe ? ).
4ian

Game Develop : Free game development software

Jenna

Quote from: 4ian on February 22, 2010, 06:27:00 PM
I've tried to add : "Execute("MyProgram.exe");" to post-build steps, but it does not seems to work. ( Post build steps aren't Squirrel scripts maybe ? ).

No, the commands you type there are just executed in the default shell.
In your case just use "[path_to]MyProgram.exe"

See the manual for more details: http://www.codeblocks.org/docs/main_codeblocks_en.html

4ian

Indeed, it works well with a command line like "c:\Program Files\VideoLAN\VLC\vlc.exe C:\Windows\Media\chimes.wav --play-and-exit". :)
Alas, when compilation fails, the post build steps aren't run..
4ian

Game Develop : Free game development software

killerbot

we should have some variable that contains the end result of compilation, which could be made available then (for scripts, plug-ins).
@Yiannis, Martin : the gurus of variables : is this possible, or does it already exist ?