Autor Beitrag
somebody
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167
Erhaltene Danke: 2



BeitragVerfasst: Sa 21.07.07 10:41 
Hi, Leute
Ich habe ein Wecker Programm erstellt. Und ich wollte nicht immer den gleichen Sound nehmen, also wollte ich eine Funktion einfügen, wo sich auf Buttonklick So ein dingens öffnet, wo man den Wecksound selber auswählen kann. So, eine Funktion, wie man hier einen Anhang hinzufügt. Also wo sich so ein Dingens(kp, wie das heißt)öffnet, wie ich es als Bild im Anhang habe. Wie geht das? Ich hoffe ich habe mein Problem verständlich genug erklärt.

mfg:somebody
Einloggen, um Attachments anzusehen!
pigfacejoe
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 332
Erhaltene Danke: 1

Win 10, Ubuntu
Delphi,Javascript, PHP, Java, Python
BeitragVerfasst: Sa 21.07.07 10:46 
Hi somebody!
Für sowas nimmst du am Besten den OpenDialog, der sich in der Sparte "Dialoge" befindet. Dann holste einen Button , wo drauf steht "Laden" oder so..
Das OnButtonClick Ereignis füllste dann mit dem Quelltext hier:
ausblenden Delphi-Quelltext
1:
2:
if opendialog1.execute then
mediaplayer1.filename:=opendialog1.filename //Wenn du TMediaplayer benutzt



opendialog1.filename liefert den ausgewählten Pfad!
Das wars dann auch schon!
Gruss PigfaceJoe
somebody Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167
Erhaltene Danke: 2



BeitragVerfasst: Sa 21.07.07 10:55 
Ich habe das jetzt als test mal ausprobiert in einem anderen Programm. Nur wenn ich jetzt den Player starten will, kann ich auf den Play Button nicht draufdrücken, obwohl er auf visible := true steht.
pigfacejoe
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 332
Erhaltene Danke: 1

Win 10, Ubuntu
Delphi,Javascript, PHP, Java, Python
BeitragVerfasst: Sa 21.07.07 10:56 
ausblenden Delphi-Quelltext
1:
mediaplayer1.autoOpen:=true;					
TGLDX
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 22



BeitragVerfasst: Sa 21.07.07 10:59 
Du musst noch Mediaplayer1.Open aufrufen nachdem du den neuen Pfad zugewiesen hast.
somebody Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167
Erhaltene Danke: 2



BeitragVerfasst: Sa 21.07.07 11:02 
geht trotzdem nicht. Zumindest nicht so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if opendialog1.execute then
        begin
             mediaplayer1.autoOpen := true;
             mediaplayer1.filename := opendialog1.filename;
        end;

Wie muss es denn richtig sein?
pigfacejoe
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 332
Erhaltene Danke: 1

Win 10, Ubuntu
Delphi,Javascript, PHP, Java, Python
BeitragVerfasst: Sa 21.07.07 11:07 
Es geht doch auch eig. nicht um den Mediaplayer, sondern um dein eigentliches Problem !
Anstatt mediapalyer1.filename:=opendialog1.filename kannst du auch schreiben edit1.text:=opendialog1.filename oder eine string Variable holn und die Fitzefatze nennen un dann schreiben FitzeFatze:=opendialog1.filename!
Mit einem "geht trotzdem nicht" kann man wenig anfangen!//Edit: hab zu früh geschrieben, da hatteste den Code noch ned..//
Hier der Code wie es gehen müsste:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
begin
if opendialog1.execute then
begin
mediaplayer1.filename:=opendialog1.filename;
mediaplayer1.open;
mediaplayer1.play;
end;
end;

end.

So, wenn du das so machst, dann schau bitte im Obkect Inspektor vommediaplayer, dass AutoOpen auf false steht. Ansonsten schreib bitte was genau nicht geht.
Gruss
PigfaceJoe
somebody Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167
Erhaltene Danke: 2



BeitragVerfasst: Sa 21.07.07 11:10 
Juhu, jetzt gehts. :D
thx

mfg:somebody