Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / Issues with Sound class & Veiwport...

Author
Message
Hairy Mug
13
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 15th Aug 2010 01:06
I have the viewport on a form and my objects show correctly but the first attempt to instantiate a sound class and "play" it results in a short bit of the wave file then nothing...
>> Using the same code and NOT using a veiwport works fine except that if the GDK "display" window looses focus, the sound stops (but does resume when the disply window gets the focus back...)

I would like to get the sounds playing using the viewport...

Any Ideas??

Hairy Mug
APEXnow
Retired Moderator
20
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 16th Aug 2010 08:55
Hairy Mug

That's an interesting issue I have not come across as yet. I'll need to investigate this a bit more, but in the mean time, can you clarify whether your code still calls the DarkGDK.Engine.LoopGDK() function when the Viewport looses focus. This function needs to be called throughout the running of your application in order to process internal messaging queues and object/audio processing?

Paul.

Hairy Mug
13
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 16th Aug 2010 14:56
Yup, I'm using the standard loop... I have already moved the loop code from the form to the static "program" class, and had the same results. Then I instantiated the sound class staticly in the program class and called it, still the same...
BTW, in my loop I call "application.doevents" so I removed those calls and I still get the same results; always about .5 seconds of the wave the first time I call the "play".
Hairy Mug
13
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 16th Aug 2010 15:20
Problem solved...
that pesky little directive "[STAThread]" was missing from my "Main" method...
It was odd since the opbects did work fine, just the sound was affected...
Thanks!

BTW: I 'm working in VS2010 with no "show stoppers"...
Hairy Mug
13
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 16th Aug 2010 15:33
still losing sound (but objects keep moving) when viewport looses focus...
Yoda Master
16
Years of Service
User Offline
Joined: 23rd Feb 2008
Location: Genova
Posted: 16th Aug 2010 17:52
@Hairy Mug

I believe that it's correct behaviour.... DarkBasic PRO has the same behaviour, if i'm not wrong...

ByteStorms
Bytes from incoming years
www.bytestorms.com
APEXnow
Retired Moderator
20
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 17th Aug 2010 00:36
Hairy Mug,

I'm glad to hear that it's working in VS2010, I'm not able to test the toolkit in this environment at present. The sound issue is very strange though. There must be some native threading issue happening within the toolkit. What would be nice, is to see if this problem occurs in the Visual C++ version of DarkGDK. Thanks for the feedback though.

Paul.

Login to post a reply

Server time is: 2024-03-28 09:59:46
Your offset time is: 2024-03-28 09:59:46