Author Topic: running 2 instances of bass  (Read 803 times)

davewilson

  • Posts: 2
running 2 instances of bass
« on: 14 Aug '10 - 09:35 »
I have been using BASS for quite a few years. The program I wrote with BASS is several thousand lines of code in Delphi. Unfortunately, I don't have the time to update my program to use a newer version of BASS. I do, however, like DSHOW and would like to implement that in my program. It seems impossible to do, as DSHOW uses a newer version of BASS. Question: is there any way to use DSHOW with a newer version of BASS and allow my old program to use an older version of BASS at the same time, within the same program?

Ionut Cristea

  • Posts: 1545
Re: running 2 instances of bass
« Reply #1 on: 14 Aug '10 - 09:54 »
  Hmmm...what version of BASS are you using?...

Maybe you could try with this:
https://www.un4seen.com/forum/?action=dlattach;topic=10079.0;attach=932

davewilson

  • Posts: 2
Re: running 2 instances of bass
« Reply #2 on: 14 Aug '10 - 10:47 »
June 19, 2003! Don't know exactly what version that is... ancient.


Code: [Select]
procedure TFormPlayer.Button10Click(Sender: TObject);
var
file1,file2: String;
begin
BASS_DSHOW_SetConfig(BASS_DSHOW_VideoRenderer,BASS_DSHOW_USEVMR);
BASS_DSHOW_SetConfig(DSHOW_VMRWINDOW,panel1.Handle);

if not OpenDialog.Execute then exit;
file1:=opendialog.FileName;
file2:=copy(opendialog.FileName, 1, length(opendialog.FileName) - 3) + 'cdg';
chan:= BASS_DSHOW_MIX_StreamCreateFile(pchar(file1),pchar(file2),0) ;
BASS_DSHOW_ChannelSetWindow(chan,panel1.Handle);

//BASS_ChannelPlay(chan,false);
BASS_StreamPlay(chan, FALSE, 0);

timer1.Enabled:=true;
end;

Notice that I had to change the ChannelPlay to StreamPlay to make the old bass.dll happy. Is that the problem?
Code: [Select]
procedure TFormPlayer.Timer1Timer(Sender: TObject);
begin
//sc.Position:= round(BASS_ChannelBytes2Seconds(Chan, BASS_ChannelGetPosition(Chan, BASS_POS_BYTE)));
sc.Position:= round(BASS_ChannelBytes2Seconds(Chan, BASS_ChannelGetPosition(Chan)));
label4.Caption:=inttostr(sc.Position);
end;
Had to change this too!
Code: [Select]
procedure TFormPlayer.scScroll(Sender: TObject; ScrollCode: TScrollCode; var
    ScrollPos: Integer);
begin
 //BASS_ChannelSetPosition(Chan, BASS_ChannelSeconds2Bytes(Chan,  sc.Position), BASS_POS_BYTE)  ;
   BASS_ChannelSetPosition(chan,BASS_ChannelSeconds2Bytes(chan,sc.Position));
end;
And this!

Code: [Select]
chan       : HSTREAM; 


« Last Edit: 14 Aug '10 - 11:15 by davewilson »

Ionut Cristea

  • Posts: 1545
Re: running 2 instances of bass
« Reply #3 on: 15 Aug '10 - 09:21 »
  Your version of BASS is 1.8a ??? BASS_DSHOW is not compatible with that version. It needs some functions that are available only on BASS >2.4.
  Maybe you should update it to the newest version.
  But, BASS_DSHOW is also available as stand alone library. Had most of the BASS_DSHOW(BASS version) features, including dsp processing, winamp dsp support,tempo, pitch etc,etc ;D
« Last Edit: 15 Aug '10 - 09:23 by Sharky08 »