Autor Beitrag
pascalsv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133

Win XP Prof. SP2 / Windows 7
Visual Studio 2008 / Silverlight 3 / Silverlight 4 Beta
BeitragVerfasst: Di 15.08.06 16:54 
Hallo zusammen,

wie erkenne ich eigentlich, dass der gespielte Titel zu Ende ist? Irgendwo muss ich danach doch den nächsten Stream aktivieren, oder denke ich verqueer??

Pascal
Harry M.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754

Win 2000, XP
D2005
BeitragVerfasst: Di 15.08.06 17:14 
TMediaPlayer.Posion eventuell?

_________________
Gruß Harry
Et spes me per dies sine te ducat et amor me ferat, si dolor spem tollit.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Di 15.08.06 17:16 
user profile iconHarry M. hat folgendes geschrieben:
TMediaPlayer.Posion eventuell?

Er hats doch von der Bass.dll ... nicht vom TMEdiaPlayer...

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Harry M.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754

Win 2000, XP
D2005
BeitragVerfasst: Di 15.08.06 17:19 
Aja sorry. Habe das eine Wort im Titel übersehen.

_________________
Gruß Harry
Et spes me per dies sine te ducat et amor me ferat, si dolor spem tollit.
smepal
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68

Win XP, Linux Mandbrake,SUSE 10.1, SUSE 9 PE, DEBIAN, Win 2000 Pro, Win XP Pro
Delphi
BeitragVerfasst: Di 15.08.06 18:10 
Hab das vor einiger Zeit mal gemacht!

ausblenden Delphi-Quelltext
1:
2:
if bass_channelgetposition(channel)=bass_channelgetlength(channel) then
//Dein Code
pascalsv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133

Win XP Prof. SP2 / Windows 7
Visual Studio 2008 / Silverlight 3 / Silverlight 4 Beta
BeitragVerfasst: Di 15.08.06 18:37 
@smepal: Du führst diesen Check in einem Timer aus, richtig? Wie ist das eigentlich, wenn man einen Timer laufen läßt und jede Sekunde VCL-Komponenten aktualisiert (Laufzeit des titels z.B.). Kostet das viel Performance? Gibt es einen saubereren Weg?

Gruß,

Pascal
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Di 15.08.06 18:38 
Naja, irgentwie MUSST du ja in deinem Label die Aktuelle Zeit anzeigen lassen, und das geht nicht anders, als jede Sekunde was neues reinschreiben. Auch wurde schon oft diskutiert, ob TTimer nun wirklich so ein Ressourcenfresser ist. Antwort: nein. Mach dir keine Sorgen, du kannst das wohl schon per Timer lösen.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
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: Di 15.08.06 22:54 
imho gibt es bei der BASS auch ein callback event für das Ende des Tracks
glaub mich daran zu erinnern, jetzt nehm ich nur noch fmod oder DirectShow, dor tgibts das aber acuh 100%ig

edit: das hab ich nach nichma 5 min. im offiziellen(!) bass forum gefunden (un4seen.com)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
private
SyncEndHandle: HSYNC; 
MessageHandle: hwnd;
FOnPlayEnd: TNotifyEvent;
{---}
procedure SyncEndProc(SyncHandle: HSYNC; Channel, data, user: DWORD); stdcall;
begin
  if Assigned(FOnPlayEnd) then
          FOnPlayEnd(Self);          
end;   

procedure play ;
 BASS_StreamPlay(channel), FALSE, 0);
SyncEndHandle := BASS_ChannelSetSync(Channel, BASS_SYNC_END, 0, @SyncEndProc, MessageHandle); 
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)
pascalsv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133

Win XP Prof. SP2 / Windows 7
Visual Studio 2008 / Silverlight 3 / Silverlight 4 Beta
BeitragVerfasst: Mi 16.08.06 07:16 
@GSE: Was war Dein Suchbegriff im Forum? Ich hatte es dort auch probiert, aber nichts passendes gefunden.

Wo käme denn mein Aufruf für Bass hin, den nächsten Titel zu starten? Sicherlich in der Prozedur SyncEndProc, oder??

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure SyncEndProc(SyncHandle: HSYNC; Channel, data, user: DWORD); stdcall;
begin
  if Assigned(FOnPlayEnd) then //käme der Aufruf des nächsten Titels hier hin??
          FOnPlayEnd(Self);          
end;


Ich verstehe nicht so recht, was hier passiert. Es wird überprüft, ob dem mitgelieferten Handle ein Ereignis vom Typ FOnPlayEnd zugewiesen ist, richtig? Aber was dann? :?


Pascal
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: Mi 16.08.06 10:24 
Zitat:
Ich verstehe nicht so recht, was hier passiert. Es wird überprüft, ob dem mitgelieferten Handle ein Ereignis vom Typ FOnPlayEnd zugewiesen ist, richtig? Aber was dann?
nein, die FOnPlayEnd-Prozedur existiert nur einmal, im Prinzip kannst du deinen Code in die SyncEndProc schreiben, im Beispiel aus dem Forum wird hier nur noch eine anderes Event ausgelöst (TNotifyEvent steht dafür allgemein nur für eine Prozedur des Typs procedure(Sender: TObject)), was zu empfehlen is um eine übersichtliche Codestruktur zu waren (also meine ich^^)

mein suchbegriff war "ended" und ich stieß damit auf den Thread: "notify when playing ended"

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)
pascalsv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133

Win XP Prof. SP2 / Windows 7
Visual Studio 2008 / Silverlight 3 / Silverlight 4 Beta
BeitragVerfasst: Mi 16.08.06 11:51 
@GSE: Ich erhalte eine Fehlermeldung, dass statt @SyndEndProc eine Variable notwendig sei. Was bedeutet dieses "@" überhaupt? Wie muss der Aufruf richtig aussehen?

Danke,

Pascal
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: Mi 16.08.06 13:13 
"@" übergibt die Adresse im Speicher in diesme Falle, die der Prozedur, damit BASS "weiß" welche prozedur es aufrufen soll (da es die ja schon gibt geben wir nur einen Zeiger mit)

welche BASS Version hast du? mit der 2.1 funktionierts (hab ich hier getestet)

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)
pascalsv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133

Win XP Prof. SP2 / Windows 7
Visual Studio 2008 / Silverlight 3 / Silverlight 4 Beta
BeitragVerfasst: Mi 16.08.06 13:26 
--> Edit: Das Problem lag (mal wieder) 90 cm vor dem Rechner... Ich habe die Prozedur meiner Forumlar-Klasse zugewiesen und muss daher den Aufruf entsprechend ändern: @TfMain.Sync...

Dazu habe ich eine generelle Frage: Viele Entwickler sammeln Funktionen und Prozeduren unter der Klasse ihres Formulars und dann noch andere darunter. Warum? Was hat das für Vor-/Nachteile? Was wäre ein "guter" Programmierstil?

Pascal
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mi 16.08.06 14:38 
*neue frage neues topic*
Nun, wenn du eine Formeigene Prozedur schreibst, ist es eine Methode der Form. Dann kannst du dir z.B. das Form1.Memo1. xx sparen, und nur Memo1. schreiben. Wenn ich in einer Prozedur auf Formeigene Objekte zugreife, dann mach ich daraus eine Methode, an sonsten nicht. Aber das ist nur meine Ansicht... Was richtig ist, weis ich auch nicht.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
pascalsv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133

Win XP Prof. SP2 / Windows 7
Visual Studio 2008 / Silverlight 3 / Silverlight 4 Beta
BeitragVerfasst: Mi 16.08.06 15:32 
Alaska, klingt einleuchtend! Ich versuche das ab jetzt auch so....

Pascal