Tiny windows patch for sound

2 views
Skip to first unread message

Ross Jones

unread,
Apr 19, 2009, 3:07:18 PM4/19/09
to giver...@googlegroups.com
Hi, I've just been building Giver on Windows, for something to do on a quiet Sunday night. I've never really submitted anything to an Open Source project before so I thought I'd start small with a very small patch (attached) to add the missing sound support on Windows - I'd appreciate feedback on anything that might be wrong with it, format, style etc - although it might be quite hard to check the style in so little code ;)

It simply uses the System.Media.SoundPlayer (avail since 2.0) to play the supplied .wav file asynchronously, and the patch is generated with diff -ub so hopefully it will be okay (assuming no /r have made it into the file).

Ross.
winplaysound.patch

Sandy Armstrong

unread,
Apr 19, 2009, 5:35:51 PM4/19/09
to giver...@googlegroups.com

Hi Ross,

This looks good for the Windows version. We may have to #if around
it, because I'm not sure if that API exists on Linux yet. There are
also some tabs vs spaces issues, but I understand that Visual Studio
doesn't make this very configurable on a per-project basis, so no
worries.

Normally we track patches on the Giver issue tracker:
http://code.google.com/p/giver/issues/list

If you have time, please file an issue there and attach your patch. I
think Ankit is away for a few weeks, but when he gets back I'm sure
he'll try and review your patch.

Thanks,
Sandy

Ross Jones

unread,
Apr 19, 2009, 5:57:17 PM4/19/09
to giver...@googlegroups.com
Sandy.

I'll try and tidy up the spacing and then do as you suggest. I didn't add the #if because I assumed the WindowsPlatformService wasn't included in the Linux build - must try and stop assuming things :(   I'll get a Linux VM up and running so I can test my patches there too.

Thanks.

Ross.

Sandy Armstrong

unread,
Apr 19, 2009, 8:45:20 PM4/19/09
to giver...@googlegroups.com
Ross,

Honestly I didn't notice this was in the WindowsPlatformService, my
bad! So you probably don't need an #if in that case. If you get a
chance to try out that API in Linux, let us know. :-)

Thanks,
Sandy
Reply all
Reply to author
Forward
0 new messages