Author Topic: Pause Toggle Switch (is this correct)  (Read 2226 times)

nobody

  • Guest
Pause Toggle Switch (is this correct)
« on: 15 Jun '03 - 18:18 »
I am using delphi and I created a button on a form to toggle the playing/paused state of the current song using the code below and I was wondering if this is the correct way to do this.

here is my code

Code: [Select]
procedure TForm1.Button1Click(Sender: TObject);
begin
if Bass_ChannelIsActive(song) = Bass_Active_Playing then
Bass_Pause()
else
Bass_Start()
end;


or should I be doing it like this

Code: [Select]

procedure TForm1.Button1Click(Sender: TObject);
begin
if Bass_ChannelIsActive(song) = Bass_Active_Playing then
Bass_ChannelPause(song)
else
Bass_ChannelResume(song)
end;


And finally what is the difference between them.

nobody

  • Guest
Re: Pause Toggle Switch (is this correct)
« Reply #1 on: 15 Jun '03 - 18:26 »
What I mean to say in the above post was what is the difference between them if you are only playing one sound at a time I understand that channel pause/resume only works on the channel you specify and bass pause/start work on all chanels but when you only use one channel what is the difference.

Irrational86

  • Posts: 960
Re: Pause Toggle Switch (is this correct)
« Reply #2 on: 15 Jun '03 - 18:46 »
No difference when you use one channel...the only difference is the code, that in one you dont need to pass a channel as parameter, and in the other you do..thats all

Basically, no difference..