Click here to Skip to main content
14,084,724 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have a quick question. (well, hopefully the answer is as quick as my question as I'm sure I'm doing something dumb.)

I have a direct sound application that runs just fine as a windows console app which makes sense because there is nothing else going on.

I'm working on a software synth and have gotten to the point where I grow weary of punching in values to a text file. It's a subtractor synth built from scratch. I now need to support knobs, sliders, etc.. to modify my sounds.

This is where things go downhill.

Waiting on notifications in my console app works just fine, but in the threaded app it waits forever. I know about MsgWaitForMultipleObjects but it just falls through and I dont' update my streaming buffers correctly.

I'm a complete noob at dialog based windows programming so if someone has some example code of waiting for directsound buffer notifications with dialog based apps I'll be very thankful.

If you want source code I don't mind providing it, I just figured if someone had a main loop that they could share with me it would trigger a spark in my mind.

Thanks in advance.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

calducciano wrote:
I know about MsgWaitForMultipleObjects but it just falls through

But with what return code? That's what tells you if you a) have a message to process, or b) one of your handles has been signalled!

For something like audio, I'd have thought you'd want a dedicated thread handling the audio, communicating with the UI thread using PostMessage (audio thread -> UI thread) and events? (UI thread -> audio thread). But I could be completely wrong - I've never really looked at DirectSound :)

BTW - does this CP article help[^] any? It's got a dialog with sliders and it talks about DirectSound :)
  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.190518.1 | Last Updated 29 Jan 2009
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100