![]() |
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:
play procerure
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;
Delphi-Quellcode:
kann mir das mal jemand mal bitte erklären wo mein fehler liegt .
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; MfG bernd |
Re: Playlist Problem
Hallo Bernd,
kein Wunder - da ist nirgendwo eine Schleife in deiner Play-Prozedur. Grüße vom marabu |
Re: Playlist Problem
hi marabu,
wie müsste den eine solche schleife aussehen? gruss bernd |
Re: Playlist Problem
Hallo Bernd,
schwer zu sagen, wenn ich so wenig über dein Programm weiß - vielleicht so?
Delphi-Quellcode:
marabu
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; |
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 |
Re: Playlist Problem
Du darfst den nächsten Titel natürlich erst abspielen, wenn der vorherige zu ende ist.
|
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 |
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.
|
Re: Playlist Problem
ahhhh ,
du meinst in etwa so:
Delphi-Quellcode:
zumindest läuft so bei mir der titel timer.
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; gruss |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:30 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz