On 19 May, shren wrote:
>   I've been reading the FreeAmp source code to try and learn how to work
> with windows, and I've learned quite a bit.  But there's one thing I can't
> figure out.  How does the FreeAmp window keep from losing focus?
> DirectSound would stop sound output if the window lost focus - it doesn't.
> I can pull other windows over top of it, or minimize it, and it still
> keeps focus.  I've read the source code and poked it with a couple of
> windows run-time tools and I still can't figure out how it does it.
> 
>   I hope I'm not polluting your list but I've been banging my head over
> this for weeks.  The elegance of the source code is making me want to
> mangle my box, especially when my source code sits there and misbehaves.

The FreeAmp window does loose focus -- we take no special precautions
to prevent that from happening. Instead, we tell the directsound plugin
to use DSBCAPS_GLOBALFOCUS on line 476 in dsoundcardpmo.cpp in
io/dsound/win32/src:

  DSBufferInfo.dwFlags            =   DSBCAPS_CTRLFREQUENCY       |
                                      DSBCAPS_CTRLPAN             |
                                      DSBCAPS_CTRLVOLUME          |
                                      DSBCAPS_GETCURRENTPOSITION2 |
                                      DSBCAPS_GLOBALFOCUS;

This prevents DirectSound from stopping soundoutput when the window
loses focus.


--ruaok         Freezerburn! All else is only icing. -- Soul Coughing

Robert Kaye -- [EMAIL PROTECTED]  http://moon.eorbit.net/~robert

_______________________________________________
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev

Reply via email to