I'm only into Delphi in a small way. (D7 professional)
Normally I plonk components on forms and when I need
to reference them I just use the component name. But...

I'm making a small audio player (freeware) and I am
creating the audio channels as required as there are
multiple sounds to be played at once sometimes.

I'm creating the instance ok (I think) and starting it
playing, but can't get how to adjust it while it's in
use. (playing) I'm freeing the instance in the OnEndPlay
handler and that seem to work out ok. Help please? :-)


function TfmMain.PlaySoundCue(CueRow: integer):boolean;
var
  SoundFilename: TFilename;
begin
  Result := False;
  SoundFilename := GrCueList.Cells[6,CueRow];
  if FileExists(SoundFilename) then begin
   with TcbDSMixerChannel.Create(dsMixer) do begin
    FileName := SoundFilename;
    Volume := -(3000-(StrToInt(GrCueList.Cells[4,CueRow])*30));
    Pan := StrToInt(GrCueList.Cells[5,CueRow])*30;
    Tag := CueRow;
    OnEndPlay := OnEndEventPlay;
    Name := 'Channel' + IntToStr(CueRow);
    Play;
    Result := True;
   end;
  end;
end;

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to