Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Playlist Problem (https://www.delphipraxis.net/55731-playlist-problem.html)

Bernd29bln 26. Okt 2005 01:32


Playlist Problem
 
Hallo,

meine playlist funktioniert super, sie hat nur ein problem, sie spielt immer nur den ersten titel.
wieso?


meine open procedure
Delphi-Quellcode:
var
   f: PChar;
begin
   if not OpenDialog1.Execute then Exit;
     f := PChar(OpenDialog1.FileName);
     strs[PlayIndex] := BASS_StreamCreateFile(False, f, 0, 0, 0);
   if strs[PlayIndex] <> 0 then
   begin
       Playlist := ListView1.Items.Add;
       Playlist.Caption := (opendialog1.FileName);
       Playlist.SubItems.Add(extractfilename(opendialog1.FileName));

      Inc(PlayIndex);
   end
   else
      Error('Error creating stream!');
end;
play procerure
Delphi-Quellcode:
begin

 playindex :=0;

    if PlayIndex < ListView1.Items.Count -1 then
     begin
       Playindex := Listview1.ItemIndex;
     
       Inc(PlayIndex);
// Play the stream (continuing from current position)
   if Playindex >= 0 then
      if not BASS_ChannelPlay(strs[Playindex], False) then
         Error('Error playing stream!');
  end;
end;
kann mir das mal jemand mal bitte erklären wo mein fehler liegt .

MfG bernd

marabu 26. Okt 2005 06:51

Re: Playlist Problem
 
Hallo Bernd,

kein Wunder - da ist nirgendwo eine Schleife in deiner Play-Prozedur.

Grüße vom marabu

Bernd29bln 26. Okt 2005 08:41

Re: Playlist Problem
 
hi marabu,

wie müsste den eine solche schleife aussehen?

gruss bernd

marabu 26. Okt 2005 10:38

Re: Playlist Problem
 
Hallo Bernd,

schwer zu sagen, wenn ich so wenig über dein Programm weiß - vielleicht so?

Delphi-Quellcode:
begin
  for playindex := 0 to Pred(strs.Count) do
  begin
    // Play the stream (continuing from current position)
    if not BASS_ChannelPlay(strs[Playindex], False) then
      Error('Error playing stream!');
  end;
end;
marabu

Bernd29bln 27. Okt 2005 08:31

Re: Playlist Problem
 
Hallo,

ich hab mal das ganze mit mediaplayer kompo ausprobiert. da geht es super, nur mit bass nicht.

wen ich die schleife ein baue, dann laufen alle titel gleichzeitig.

hmmmm, :wall:

gruss bernd

Luckie 27. Okt 2005 08:33

Re: Playlist Problem
 
Du darfst den nächsten Titel natürlich erst abspielen, wenn der vorherige zu ende ist.

Bernd29bln 27. Okt 2005 08:37

Re: Playlist Problem
 
hi lukie,

ist schon klar , ich bin mmtool geschädigt , da war alles einfacher :roll: .

aber auch teurer . wie tuhe ich ihm den das vermitteln .

gruss bernd

Luckie 27. Okt 2005 08:39

Re: Playlist Problem
 
Du weißt, wie lang das Stück ist (-> bass.dll), du zählst einfach die Sekunden mit, bis keine mehr übrig sind, dann sollte es eigentlich zu ende sein.

Bernd29bln 27. Okt 2005 08:45

Re: Playlist Problem
 
ahhhh ,

du meinst in etwa so:
Delphi-Quellcode:
var
  p: DWORD;
  akttime : integer;
begin
  BASS_ChannelBytes2Seconds(Chan,
BASS_ChannelGetLength(Chan));
  akttime := round(BASS_ChannelBytes2Seconds(Chan,
BASS_ChannelGetPosition(Chan)));

  if (seeking = -1) then // not seeking - update pos scroller
      begin

         p := Trunc(BASS_ChannelBytes2Seconds(chan, BASS_ChannelGetPosition(chan)));
        trkPos1.Position := p;

  if BASS_ChannelIsActive(Chan) = 1 then

  ToTimer1.Text := Format ('%0.2d:%0.2d',[akttime div 60,akttime mod 60]);

  if BASS_ChannelIsActive(Chan) = 3 then
  end
  else
  begin
  led1.Blink := False;
  if BASS_ChannelIsActive(Chan) = 0 then
 
  if BASS_ChannelIsActive(Chan) = 1 then

  if BASS_ChannelIsActive(Chan) = 2 then
  ToTimer1.Text := 'Fehler';
   end;

end;
zumindest läuft so bei mir der titel timer.

gruss


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:55 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz