Author Topic: MULTI-Instance Question  (Read 3047 times)

Chris

  • Posts: 2221
MULTI-Instance Question
« on: 13 May '03 - 20:06 »
Hi..so now I`m Back with one Qustion..at this Moment I`m developing a BassPlayer for Delphi....
(supporting  Speaker,Pitch,FadeOut,FadeIn,Effects,other location of the dll ) and many more things.....If I`m ready i will post it but vor now my Question.

The Orginal Dynamic.pas Code ist
//////////////////////////////////////////////////
const BASS_Handle:Thandle=0;
Function Load_BASSDLL (const dllpath:string ; const dllfilename:string) :boolean;

Function Load_BASSDLL (const dllpath:string ; const dllfilename:string) :boolean;
var DlPath:String;
var pt:pchar;
var oldmode:integer;
begin
 if BASS_Handle<>0 then result:=true {is it already there ?}
 else begin {go & load the dll}
   if (dllpath[length(dllpath)]<>'\') then dlpath:=dllpath+'\' else dlpath:=dllpath; {path with \ or without... add a \ if there isn't one...}
   pt:=pchar(dlpath+dllfilename); {now cast it a bit}
   oldmode:=SetErrorMode($8001);
   BASS_Handle:=LoadLibrary(pt); // obtain the handle we want
   SetErrorMode(oldmode);
   if BASS_Handle<>0 then
      begin {now we tie the functions to the VARs from above}      


And here Is my Error How can I add more BassInstances ??
in my Componnt I have an Extra Option where the User can set the directory from the location off the bass.dll

Thanks
Chris
« Last Edit: 13 May '03 - 20:07 by Chris »

fredvs

  • Posts: 325
Re: MULTI-Instance Question
« Reply #1 on: 13 May '03 - 23:00 »
Hello Chris, i dont understand your question, what want you to do ?

Ian @ un4seen

  • Administrator
  • Posts: 26223
Re: MULTI-Instance Question
« Reply #2 on: 14 May '03 - 12:59 »
Quote
And here Is my Error How can I add more BassInstances ??

I don't know if Delphi allows arrays of function pointers. If it does, you can use that (as the MULTI.C example does). If it doesn't, you can duplicate the function "vars" in DYNAMIC_BASS.PAS, and rename them slightly for the 2nd instance.