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.

DLL Talk / DB, Delphi , DelphiX & Fmod?

Author
Message
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 4th Sep 2005 15:46
I'm trying to interface Fmod into Dark Basic,up to now
everythings working well Bars & VU meters except for the oscillascope display, it seems that the callback routine just hasn't got the speed to achieve a good display. It's called in the main loop prior to the sync update in basic. Although the same routine which was wrote in Delphi with the DelphiX component achieves good display results.

My questions are:-

1). Is it possible to write to the screen inside the callback routine to a DelphiX surface i.e. DXpaintbox. And display it on the Dark Basic screen without too much flicker?

2). If so, How? Or point me in the right direction.

Cheers! Much appreciated

Leo
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 4th Sep 2005 15:57
P.S. go to the link below to see a Delphi example of the oscillascope in use. I'm trying to get the same effect!

leo
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 4th Sep 2005 15:57 Edited at: 3rd Mar 2009 21:16
Whoops sorry!

here you go

Link * removed ! *
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 4th Sep 2005 16:42
It's been a while since I last used DelphiX. Does the DXPaint box have a window handle? If not, you can place it on a (transparent) component that has a window handle and then use the Windows Api function SetParent to make it a child of the DB window.


Play Nice! Play Basic! Version 1.088
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 4th Sep 2005 17:33
Hmmm,interesting Using a transparent form with the DelphiX
components on it.. never thought of that,although it would bloat
the DLL big time. But none-the-less,quite feasible! Would have to code to be always on top. I Will let you know how I go on.

Big Thanks!

Leo
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 4th Sep 2005 18:21
I wouldn't use a form for it, though... A panel-like component would do.


Play Nice! Play Basic! Version 1.088
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 8th Sep 2005 23:10
Empty,
Tried the Dx surface,it wouldn't write to it. so went and tried a form with couple of image controls. I believe advice given by you on an old post here:-

http://forum.thegamecreators.com/?m=forum_view&t=43774&b=18

Anyway, this seems to work not in the showmodal form but using events, even from within a timer! The graphics are updated i.e. background buffer to drawing screen on the form.
The form's border set to bsNone has the effect of just showing
the scope's background so no need to go to transparent forms and the like.

Two issues though,any help would be appreciate.

1. Access violations happen when I try to copy Fmod's
oscillascope buffer from my callback routine which
is in one unit called 'CallBack' to the other routine
which is in the forms unit called Scope.

Example:- Scope.oscbuffer[n]:=CallBack.oscbuffer[n];

2. It's one of focus, just carn't seem to shut it down
before I close the main DB prog.


Cheers

Leo
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 9th Sep 2005 02:09
Well without knowing the code (nor how the fmod oscilloscope works) it's a bit difficult to tell what the problem is. However I wouldn't use a form for that.
If I understood you correctly, you want to display the DXPaintBox component on the DBPro form, right?
Unless you need to handle any DXPaintBox events, I'd place that very same paintbox on a panel, and then with
Windows.SetParent(Panel1.handle, DBproWindowHandle);
Panel1.Left := 0;
Panel1.Top := 0;
Windows.ShowWindow(Panel1.handle, SW_SHOW);

display the panel on the DBpro form.


Play Nice! Play Basic! Version 1.088
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 9th Sep 2005 04:18
It's too bad that FMOD doesn't let you use their library for commerical releases for free. I looked up the prices they charge and its $2000 for the old version, and $4000 for the new.

If you're doing something for free, this is one awesome plugin you're creating.

The best audio plugin for DarkBASIC Pro!
Plays Ogg Vorbis,MP3,FLAC,uncompressed WAV,AIFF,MOD,S3M,XM,and IT files.
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 9th Sep 2005 21:20
@Empty,
Yeah sure,here you go the basic Dll code containing the
main functions. I've attached it.

I take no credit whats-so-ever for the callback routine that
was found on Fmod's forum a couple of years back and works
well in Delphi.

The other functions are just to get it up and running in DB pro.
The scope works inside a function in DB but like I've said it
hasn't got the speed to display a reasonable scope which is
why I turned to Delphi to write it. Once done I intend to go onto
a spectrum display too. having sorted them out then I'll write a
Dll to use within DB pro.Anyway,have a look at it,if you need the db code too then I'll send it.

BIG THANKS! I Appreciate your help.

Leo


@Torrey

Yes! It is expensive, but free for personnel and/or non commercial use and I have no intention to break Fmod's license.

As for a plugin to DB pro, I'll release when done( this is a hobby,may take some time) Big believer in if you take something out
of a community then give something back and everyone benifits.

Regards

Leo
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 9th Sep 2005 22:21
Empty,
How do you create a panel in a DLL without a form?
the DB prog is in full sceen display no forms.

Leo
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 9th Sep 2005 23:18
Torrey,
I've just seen, nice plug-in mate! As for Audiere I'm more
interested in DSP buffers and the like to display a graphic form
of the sound being played.

Regards

Leo
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 10th Sep 2005 00:09
Empty,
got the actual timer,graphic and drawing to the image canvas
working now, the borderless form stays on too, with

setWindowPos(Form1.handle, HWND_TOPMOST,x,y,0,0,0);

still unable to transfer the DSP buffer from the array
CallBack.Oscbuffer[I] to other unit containing timer/draw
routine.

It still throws it's dummy out when trying to stop DB though

catch you later

Leo
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 10th Sep 2005 13:43
Empty,
Got the Oscbuffer array working now so,the oscillascope works well!

Declared the Oscbuffer array(DSP unit) in the interface section of
the unit,which! as you know gives access to the variable to all units! And yes,I declared as global unit only (oh well, we live and learn! ).

Still have the issue when shutting it down, it still throws it's dummy out, perhaps when you have time, you could show me how to do
it with a panel component and not like I've done with a Form.

Cheers

Leo

PS Now I know it's possible to untilize Fmod's DSP unit from
inside a DLL and make it work with DB Pro I'll start work
on an Fmod extension to Dark Basic Pro.
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 11th Sep 2005 02:35
If the DBpro App is in Fullscreen Exclusive, panels or any other windows control for that matter, will not work. If it's in "normal" Fullscreen I'll gladly post a snippet that shows how to place Delphi controls in a DBpro window.


Play Nice! Play Basic! Version 1.088
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 11th Sep 2005 14:35 Edited at: 3rd Mar 2009 21:18
It's just in full screen mode not Exclusive. It would be interesting to see how to do it with a panel component,think
that would resolve the focus issue ( see below ).

I've uploaded the full source DB and the Delphi 7 code for the DLL.
If you've got time take a look, no worries if not. The zip size is
4.06 meg!
* link removed ! *

The DLL only concerns itself with the scope,CallBack and playing mod files at the moment,it really isn't an a big deal doing mpeg,ogg and wave files, so that's been put on the back burner at present.

The Focus issue

To shut the DB prog down you need to press the spacebar twice!
The first press gives DB focus, then the second shuts it down
so no dummy spat out! It's only a quick fix at the moment till
it can be resolved it.


cheers

Leo
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 11th Sep 2005 17:03
The Focus issue

Resolved ! Done with a flag returned and checked inside DB's main
loop.

Still interested in doing the same thing with a panel though,
any chance of some code?

Onwards!
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 17th Dec 2005 19:51 Edited at: 3rd Mar 2009 21:19
Hello Again!
Been a while since I did anything with this prog.
Anyway, got the scope, meters and bars working fine now and
decided to give it a nice installer too!

Take a look here

* Link Removed ! *

Let me know what you think

Leo

Login to post a reply

Server time is: 2024-11-21 18:33:39
Your offset time is: 2024-11-21 18:33:39