Author Topic: Playing a sound when compilation has finished/failed  (Read 5615 times)

Offline 4ian

  • Single posting newcomer
  • *
  • Posts: 5
    • Compil Games
Playing a sound when compilation has finished/failed
« on: February 22, 2010, 05:27:45 pm »
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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5272
Re: Playing a sound when compilation has finished/failed
« Reply #1 on: February 22, 2010, 05:48:09 pm »
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

Offline 4ian

  • Single posting newcomer
  • *
  • Posts: 5
    • Compil Games
Re: Playing a sound when compilation has finished/failed
« Reply #2 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 ? ).
4ian

Game Develop : Free game development software

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Playing a sound when compilation has finished/failed
« Reply #3 on: February 22, 2010, 06:53:07 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

Offline 4ian

  • Single posting newcomer
  • *
  • Posts: 5
    • Compil Games
Re: Playing a sound when compilation has finished/failed
« Reply #4 on: February 22, 2010, 08:08:12 pm »
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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5272
Re: Playing a sound when compilation has finished/failed
« Reply #5 on: February 22, 2010, 10:18:52 pm »
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 ?