Autor Beitrag
lblbw
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 122

Win XP, Win 7
Delphi7 Enterprise
BeitragVerfasst: Sa 03.05.08 21:55 
Hallo ich bin mal wieder da :D

Ich benutze die Slider-Kompenente von BassPlayer als Progressleiste von Audio-Dateien. Als Progressleiste "ohne" Funktion, gehts sehr gut. Sprich: Der Fortschritt wird richtig angezeigt. Wenn ich aber nun die Progressleiste manuell bewege springt die Audiodatei immer ans Ende. Als Vorlage habe ich (Gruß an Gausi :D) MeMP benutzt.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.Slider1StartTracking(Sender: TObject);
begin
  NowTracking := true;
end;

procedure TForm1.Slider1StopTracking(Sender: TObject);
var
  SongPos : DWORD;
begin
  if not radio = true then
  begin
    SongPos := Trunc(Slider1.Value * MeMPPlaylist.PlayingFile.Dauer / Slider1.MaxValue);
    MeMPPlaylist.Progress := SongPos;
  end;
  NowTracking := false;
end;


Moderiert von user profile iconNarses: Titel geändert.
lblbw Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 122

Win XP, Win 7
Delphi7 Enterprise
BeitragVerfasst: Do 08.05.08 08:32 
Schade, das keiner Weiß worans liegt. Wer den kompletten Quelltext haben will, soll sich bei mir melden!
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Do 08.05.08 08:40 
Wenn ich mein Tut richtig in Erinnerung habe, dann gibt Progress den relativen Fortschritt an. 0 ist am Anfang, 1 am Ende. D.h. die Dauer brauchst du zur Berechnung des Progress gar nicht. Einfach nur Value/Max.

_________________
We are, we were and will not be.
lblbw Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 122

Win XP, Win 7
Delphi7 Enterprise
BeitragVerfasst: Do 08.05.08 09:10 
Habe es eben ausprobiert, und er springt jetzt nicht mehr ans Ende eines Liedes, sondern immer an den Anfang!
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Do 08.05.08 09:14 
Wenn du Value durch Max teilst und Trunc drauf ansetzt, ist das Ergebnis immer 0. Progress ist vom Typ double.

_________________
We are, we were and will not be.
lblbw Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 122

Win XP, Win 7
Delphi7 Enterprise
BeitragVerfasst: Do 08.05.08 10:29 
Ich danke dir Gausi, jetzt geht es.