Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi BASS_ChannelIsActive (https://www.delphipraxis.net/62909-bass_channelisactive.html)

Nils_13 11. Feb 2006 10:51


BASS_ChannelIsActive
 
Hi,

seht ihr den folgenden Fehler im Code (Ausdruckstyp muss Boolean sein)? Wenn ich '= True' dahinter schreibe ist es inkompatibel.
Delphi-Quellcode:
if BASS_ChannelIsActive(BASS_ACTIVE_PLAYING) then
begin
  ...
end;

alcaeus 11. Feb 2006 10:53

Re: BASS_ChannelIsActive
 
Hast du schon mal dran gedacht, dass es ein Int sein koennte? Das hat mir Google im ersten Ergebnis verraten: Bei Google suchenBASS_ChannelIsActive delphi :roll:

Greetz
alcaeus

Daniel 11. Feb 2006 10:55

Re: BASS_ChannelIsActive
 
Wenn "BASS_ChannelIsActive" eine Funktion ist, deren Rückgabewert vom Typ Boolean ist, so muss da auch kein "true" stehen.

Wenn ich Dich richtig verstehe, geht Folgendes nicht:

Delphi-Quellcode:
if BASS_ChannelIsActive(BASS_ACTIVE_PLAYING) = true then machwas;
Mir unverständlich. Poste doch mal die Signatur dieser Funktion.

Nils_13 11. Feb 2006 11:21

Re: BASS_ChannelIsActive
 
@alcaeus: Die If-Abfrage muss sein.
@Daniel:
Genau das läuft nicht, muss aber unbedingt laufen, ich muss überprüfen, ob gerade abgespielt wird.
Falls ich dich richtig verstanden habe:
Zitat:

Checks if a sample, stream, or MOD music is active (playing) or stalled. Can also check if a recording is in progress.

DWORD WINAPI BASS_ChannelIsActive(
DWORD handle
);


Parameters
handle The channel handle... a HCHANNEL / HMUSIC / HSTREAM / HRECORD handle.


Return value
The return value is one of the folowing.
BASS_ACTIVE_STOPPED The channel is not active, or handle is not a valid channel.
BASS_ACTIVE_PLAYING The channel is playing (or recording).
BASS_ACTIVE_PAUSED The channel is paused.
BASS_ACTIVE_STALLED Playback of the stream has been stalled due to there not being enough sample data to continue playing. The playback will automatically resume once there's sufficient data to do so.


Remarks
When using this function with a decoding channel, BASS_ACTIVE_PLAYING will be returned while there is still data to decode. Once the end has been reached, BASS_ACTIVE_STOPPED will be returned. BASS_ACTIVE_STALLED is never returned for decoding channels - you can tell a decoding channel is stalled if BASS_ChannelGetData returns less data than requested, and this function still returns BASS_ACTIVE_PLAYING.

Die Muhkuh 11. Feb 2006 11:25

Re: BASS_ChannelIsActive
 
hi,

wenn, dann msus das so aussehen:

Delphi-Quellcode:
if BASS_ChannelIsActive(aChannel) = BASS_ACTIVE_PLAYING then
...

Daniel 11. Feb 2006 11:28

Re: BASS_ChannelIsActive
 
Andreas hat es Dir eigentlich beantwortet. Wenn die Funktion einen numerischen Wert (z.B. Integer) zurückliefert, kannst Du nicht auf 'true' prüfen.

Was Du meinst, ist vermutlich Folgendes:

Delphi-Quellcode:
if BASS_ChannelIsActive(BASS_ACTIVE_PLAYING) = BASS_ACTIVE_PLAYING then machwas;

... bei allem Respekt ... aber ich rate Dir, Dir mal die Grundlagen-Tutorials von dsdt.info anzusehen. Du hattest ja schon alle Bausteine zusammen: Die Funktion und in der Dokumentation eine Liste an möglichen Rückgabewerten. Damit sollte man in der Lage sein, so eine Abfrage wie von Dir gewünscht zu formulieren.

Die Muhkuh 11. Feb 2006 11:30

Re: BASS_ChannelIsActive
 
Zitat:

Zitat von Daniel
Delphi-Quellcode:
if BASS_ChannelIsActive(BASS_ACTIVE_PLAYING) = BASS_ACTIVE_PLAYING then machwas;

Verlangt der Parameter nicht das Handle eines Channels? ;-)

Daniel 11. Feb 2006 11:32

Re: BASS_ChannelIsActive
 
Das soll Nils selber herausfinden. :mrgreen:

Die Muhkuh 11. Feb 2006 11:37

Re: BASS_ChannelIsActive
 
Zitat:

Zitat von Daniel
Das soll Nils selber herausfinden. :mrgreen:

Stimmt :mrgreen:

Nils_13 11. Feb 2006 11:40

Re: BASS_ChannelIsActive
 
Ja der will einen Channel und einen Boolean-Wert. Danke.


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:02 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz