Autor Beitrag
Annonym
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Mi 25.06.03 23:12 
Hallo, hat einer einde Idee, wie ich mehrere Sounds hintereinander abspielen kann. Es soll möglichst keine Pause dazwischen sein.
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Mi 25.06.03 23:49 
Wie wäre es mit einer Listbox, in der die Dateinamen stehen? Es muß dann geprüft werden, ob die Dateien existieren und wenn dem so ist, spielst du sie mit der TMediaPlayer-Komponente ab. Du mußt dann halt schauen. Eine Art Playlist eben..

_________________
Hasta La Victoria Siempre
Annonym Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 26.06.03 09:12 
Titel: Schön aber
diese Idee hatte ich auch schon. Nur wie spiele ich Sounds nacheinander ab. Wenn ich die Befehle aufrufe spielt der imme nur das letzte ab. Wie kann ich warten bis eins zuende ist und dann das nächste starten?
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Do 26.06.03 11:19 
Die Delphi-Hilfe, dein Freund und Helfer hat folgendes geschrieben:
OnNotify tritt ein, sobald die Ausführung einer Methode zur Steuerung des Media-Players (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, Resume, Rewind, StartRecording, Step oder Stop) beendet ist. Voraussetzung dafür ist allerdings, daß die Eigenschaft vor dem Aufruf der Methode auf True gesetzt wurde. Nach einem OnNotify-Ereignis muß die Eigenschaft Notify erneut auf True gesetzt werden, damit das nächste OnNotify-Ereignis eintreten kann.


mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Annonym Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 26.06.03 13:01 
Ja ok ich habs jetzt folgendermaßen getestet:

in OnCreate des Formulars:

ausblenden Delphi-Quelltext
1:
Player.Notify   := True;					


Und dann in das OnNotify ereignis des Players:

vorher:

ausblenden Delphi-Quelltext
1:
2:
3:
const

  ModeStr: array[TMPModes] of string = ('Nicht bereit''Stop''Wiedergabe''Aufnahme''Suchen''Pause''Geöffnet');


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
with Sender as TMediaPlayer do
  begin
    Form1.Caption := ModeStr[Mode];
    Notify := True;
  end;


Wenn das Soundstück gestartet wird steht auch Wiedergabe da, wenn ich auf stop drück steht stop da, aber wenn ich das lied zu ende laufen lasse steht immer noch wiedergabe da, obwohl es aufgehört hat.
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Do 26.06.03 19:27 
Weiß nicht warum da immer noch Wiedergabe steht?

Bei mir funktioniert´s mit diesem Code einwandfrei mehrere Lieder hintereinander abzuspielen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
if (mediaplayer1.mode = mpstopped) and (mediaplayer1.position = mediaplayer1.length) then begin
{Nächstes Lied laden}
mediaplayer1.notify := true;
end;


mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Annonym Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 26.06.03 19:48 
Titel: bitte hilf mir
es funktioniert auch damit nicht. ich brauche ein programm, das 3 sound dateien abspielt und zwar folgendermaßen:

sound1
sound2
sound1
sound3

und das immer weiter. aber es klappt nicht. kannst du mir ein kleines beispiel prog geben?
RainerT
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Do 07.08.03 12:12 
Hallo GSE,

Dein Code-Beispiel hat eine Klinke: wenn jemand auf "Stop" drückt, wenn grade das Ende des Liedes erreicht ist, wird trotzdem das nächste Lied angespielt, oder? Ok, es sind Millisekunden, also sehr unwahrscheinlich.

Aber kann man nicht irgendwie unterscheiden, ob Onotify ausgelöst wurde, weil man einen Button geklickt hat oder "automatisch"