Autor Beitrag
JacFab
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 111



BeitragVerfasst: Sa 03.05.03 17:09 
Ich habe mehrere Dateien, die mit Fmod abgespielt werden sollen in einer liste. wenn eine mp3 durchgelaufen ist, soll also die nächste abgespielt werden.
Aber wie mache ich das, ohne einen timer zu benutzen, der die ganze zeit fragt, ob eine datei grade spielt?
Gibt es da eine callback funktion?
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Sa 03.05.03 20:19 
FSOUND_Stream_SetEndCallback dürfte Funktion deiner Wahl sein

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 03.05.03 22:46 
und wo willst du bitte überprüfen ob die datei zu ende gespielt wurde ?
du MUSST es in einem Timer überprüfen...... oder wo soll es geschen ?

_________________
MFG
Michael Springwald, "kann kein englisch...."
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Sa 03.05.03 23:13 
SetEndCallback übergibt man als ersten Parameter einen Stream (der, der überprüft werden soll, logischerweise ;-) ) und als zweiten einen Funktionspointer. Diese Funktions wird dann aufgerufen, sobald der Stream fertig ist mit Spielen (aber nicht, wenn er im Loop-Modus ist, steht alles in der Hilfedatei). In dieser Funktion kannst du dann zum Beispiel die nächste Datei abspielen (im gleichen Stream, dann wird beim Ende dieser Datei wieder die Funktion aufgerufen, aber vorsicht, dann braucht man irgendeine Abbruchbedingung, sonst spielt er endlos *g*).

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 03.05.03 23:21 
Und wo muss man die funktion hinschreiben ?
gleich beim laden ?
währe ganz praktisch für mein problem:)

_________________
MFG
Michael Springwald, "kann kein englisch...."
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Sa 03.05.03 23:59 
Irgendwohin, nachdem die Datei geöffnet wurde (also der Stream einen gültigen Pointer darstellt).
Die Funktion, die aufgerufen wird, muss allerdings (aus irgendeinem Grund) außerhalb aller Klassen sein, darf also nicht in den private- oder public-Abschnitt der Form oder in sonst irgendeine Klasse.
Und die Funktion muss wie folgt deklariert sein:
ausblenden Quelltext
1:
function FUNKTIONSNAME(Stream: PFSoundStream; Buff: Pointer; Length, Param: Integer): ByteBool; cdecl;					

Es muss also eine Funktion sein und diese Parameter (in der Reihenfolge) haben, damit das klappt.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
JacFab Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 111



BeitragVerfasst: So 04.05.03 01:18 
danke auch an mimi, denn du hast genau die fragen gestellt, die ich sonst gestellt hätte!
alles klar.. ich denke so kriege ich das hin.
JacFab Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 111



BeitragVerfasst: So 04.05.03 01:51 
es hat doch nicht geklappt.
ich weiß nicht, wie ich die funktion aufrufen soll, denn für was stehen die ganzen parameter bei
function FUNKTIONSNAME(Stream: PFSoundStream; Buff: Pointer; Length, Param: Integer): ByteBool; cdecl;

ich hab das bisher so geschrieben:

FSOUND_Stream_SetEndCallback(stream[1],SongEnde(stream[kanal],Nil,nil,1),1)

dies verursacht jedoch bisher einen fehler...
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: So 04.05.03 12:36 
nein nein nein.
Man muss für den Funktionspointer nicht die PArameter mit angeben. Nur den Funktionsnamen. Im SetEndCallback also nur SongEnde angeben, mehr nicht. Was die Parameter bedeuten, steht in der Hilfedatei.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
JacFab Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 111



BeitragVerfasst: So 04.05.03 12:50 
wenn ich keine parameter übergebe sagt er mir
"nicht genügend wirkliche parameter"
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: So 04.05.03 14:20 
Das ist seltsam.
Wie und wo ist denn deine SongStop-Funktion deklariert? Bei klappt das nämlich...

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: So 04.05.03 14:27 
mm, ich werde es mal testen.... ich hatte nämlich eingige probleme damit, wie ich die musik wiederholen kann bzw eine neue apspielen kann wenn die alte vorbei zu ende ist, ich musst deshalb extra einen Trehd installiezieren um das zu ereichen weil der normale Timer kommt irgenwie nicht mit den DXTimer zurecht:)

Aber sollte es funktionieren were es eine sehr einfache möglichkeit....

_________________
MFG
Michael Springwald, "kann kein englisch...."
JacFab Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 111



BeitragVerfasst: So 04.05.03 15:36 
tommy kann ich dir vielleicht mal meinen code schicken und du guckst dir den error mal kurz an?
es ist nich so viel... da blickst du schnell durch!
Rool
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: So 04.05.03 15:39 
Titel: ...
hast wahrscheinlich das @ vergessen...

_________________
MFG Rool
JacFab Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 111



BeitragVerfasst: So 04.05.03 16:17 
was für ein @?
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: So 04.05.03 16:22 
Stimmt, was für ein @? Bei mir klappt's auch ohne.
Oder hat Borland in Version 6 mal wieder alles neu gemacht? Welche Delphi-Version hast du denn? Unter D6PE läuft alles ohne @, ohne Parameter und ohne Fehlermeldungen...
Klar, Code kannst du mir schicken.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Rool
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: So 04.05.03 16:40 
Titel: ...
Wenn man einer Funktion seine Callback-Funktion übergibt, übergibt man eigentlich immer einen Pointer auf die Funktion. DESWEGEN: @Funktionsname !!! (AddressOf)

_________________
MFG Rool
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: So 04.05.03 16:52 
Echt? Nicht das ich wüsste... :roll:
Zumindest klappt's bei mir auch ohne @, und das ist auch gut so ;-)

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Rool
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: So 04.05.03 21:03 
Titel: ..
jo, stimmt. das ist aber ganz schön selten, wenn du mal mit windows-callbackfunktionen arbeiten solltest, musst du IMMER einen Pointer (mit @) übergeben!! hier geht es so, weil du nicht direkt einer C-DLL die Funktion übergibst, sondern erst der Delphi-Unit von FMod, die es dann in einen Pointer umwandelt!

_________________
MFG Rool
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: So 04.05.03 22:45 
Tja, es lebe das DLL-Wrapping :mrgreen:

Edit: JacFab, geht's jetzt?

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert