Autor Beitrag
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 20.04.05 10:46 
hallo, ich habe eine MediaPlayer Komponente und möchte folgendes:

Bei der Wiedergabe soll der blaue balken der Trackbar die aktuelle Position anzeigen und wenn der pfeil erreicht ist soll die wiedergabe stoppen, wenn der pfeil ganz link ist, soll alles gespielt werden, wenn er rechts ist auch.

Möglich wäre ausch, dass sich beides bewegt und man die derzeitige Position aus wählen kann, wie beim windows media player, wie mache ich das ?

code gibts hier:
www.delphi-forum.de/...e84276f38745b708a385
HolgerB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 91

Win XP
D6 Pers
BeitragVerfasst: Mi 20.04.05 10:58 
Hallo,

Du benötigst einen Trackbar und einen Timer.

Über trackbar.SelEnd kannst du das Ende des Blauen Balkens einstellen. Über Position die Position des Pfeils.
Bei jedem Auslösen des Timers musst du den Blauen Blaken neu positionieren und die Position des Pfeils abfragen. Wenn dein Clip am Pfeil vorbei ist, musst du die Wiedergabe anhalten.

gruß
Holger
F34r0fTh3D4rk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 20.04.05 11:00 
ich weiß, aber des funzt net zusammen mit mediaplayer1.trackposition[x], geht net, auch net wenn ichs runde.
F34r0fTh3D4rk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 20.04.05 12:19 
ich habe da ein problem, ich habe ein xp manifest eingebunden und die Selection wird net angezeigt, also möchte ich das jetzt nur noch so machen, dass die trackbar die aktuelle position anzeigt und man diese verändern kann, aber wie ? :shock: :?
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Mi 20.04.05 12:42 
du brauchst einen timer und ein event bei trackbar1.onchange
vielleicht hilft dir das hier: www.delphi-forum.de/...ghlight=ptrackerdata

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Blackheart
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 164

ME
D3Prof.-D6Standard
BeitragVerfasst: Mi 20.04.05 13:00 
Vieleicht hilft das ein bischen.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Mediaplayer1.Close;
  Mediaplayer1.FileName := 'test.wav';
  Mediaplayer1.Open;
  TrackBar1.Enabled := True;
  TrackBar1.Max := MediaPlayer1.Length;
  Mediaplayer1.Notify := True;
end;

procedure TForm1.TrackBar1Change(Sender: TObject);
begin
  Mediaplayer1.Position := TrackBar1.Position;
end;

procedure TForm1.MediaPlayer1Notify(Sender: TObject);
begin
  TrackBar1.Position := Mediaplayer1.Position;
end;
F34r0fTh3D4rk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 20.04.05 18:54 
da tut sich nichst :? (ok man kann es setzen aber beim notify tut sich nichst, soll ich stattdessen n timer nehmen ?) kann ich dazu auch irgendwie die zeit in 00:00:00 anzeigen lassen ?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
  mediaplayer1.Position:= trackbar1.Position;
  mediaplayer1.play; //Besser so ^^
end;
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Do 21.04.05 00:35 

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
F34r0fTh3D4rk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Fr 22.04.05 14:38 
in dem code hab ich leider nichts gefunden, außer ein paar units dir mir fehlen ^^
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Sa 23.04.05 11:40 
wenn du den code compilieren willst ändere DCTrackBar zu Trackbar (im .dfm und .pas) und ignoriere die verweise auf die volume-control komponente.
der code für die anzeige usw ist in der pas drinne, musst nur deine augen aufmachen :shock:

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
F34r0fTh3D4rk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Sa 23.04.05 14:40 
welche dc trackbar und trackbar ? hab nur ne unit, n formular, ne projektdatei und ne ressource :shock: