Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#3

Re: Powerbasic 1 zeilen problem

  Alt 6. Jun 2008, 20:06
Zitat von marabu:
Hallo Emil,

irritiert dich der Doppelpunkt?

In PowerBasic (u.a.) können mehrere Statements in eine Zeile geschrieben werden, wenn man sie mit dem Statement Separator (Doppelpunkt) voneinander trennt.

Freundliche Grüße
Hi
Nein eigentlich nicht denn das ist mir unter VB bekannt
Was mich irritiert ist diese zeile (sorry) -->

Delphi-Quellcode:
glRC : HGLRC;
hProc : LongInt;

BBP_ProcHandle ist ne Function stellt kein problem dar.
BBP_Plugin(BBP) das auch nicht.
Code:
    If glRC <> 0 Then
       hProc := BBP_ProcHandle(0, 0);
       if hProc <> 0 then
         --> CALL DWORD hProc USING BBP_Plugin(BBP) TO nRet

CALL DWORD hProc USING und das ganze nach nRet
das irritiert mich.

Meine vermutung! Führe BBP_Plugin(BBP) oder nRet aus
Wenn dann in welchen zusammen hang wie wird geprüft ob nun die Funktion oder aber nRet
maßgeblich ist.

EDIT:
Auch ist die Schnittstelle etwas unverständlich..
Habe mich in dem Forum angemeldet allerdings kann mir da wegen meinen schlechten Englisch kaum jemand helfen..


Code:
//Yes, BassBox has a plugin interface, and you can find the full history of the project there:
//http://www.jose.it-berater.org/smfforum/index.php?topic=1364.0
 
//Each of the BassBox plugin in an independant plain Win32 DLL that does use one single exported function,
//that works like a standard SDK Window Proc.
 
'// The main exported plugin's function would be bbProc, like this:
FUNCTION BBProc ALIAS "BBProc" (BYREF BBP AS BBPLUGIN) EXPORT AS LONG
    LOCAL nRet AS LONG
    nRet = %BBP_SUCCESS
    SELECT CASE LONG BBP.Msg
    CASE %BBP_RENDER
         '// Draw the scene using BBP.LeftPeak and BBP.RightPeak
    CASE %BBP_CREATE
         '// Retrieve plugin details
         BBP.Title   = "My BB plugin"
         BBP.Author  = "My Name"
         BBP.Version = MAKDWD(1, 0) '// Version 1.0"
         BBP.RenderTo = %BBP_OPENGL   '// or %BBP_GDIPLUS, or %BBP_DIRECTX
    CASE %BBP_INIT
         '// Do your code initialisation there
    CASE %BBP_SIZE
         '// The size of the view port has changed.
    CASE %BBP_KEYBOARD
         '// Handle all Windows keyboard messages there
         Msg = BBP.WinMsg
         wParam = BBP.wParam
         lParam = BBP.lParam
    CASE %BBP_MOUSE
         '// Handle all Windows mouse messages there
         Msg = BBP.WinMsg
         wParam = BBP.wParam
         lParam = BBP.lParam
    CASE %BBP_DESTROY
         '// Free up your resources there
    CASE ELSE
        nRet = %BBP_ERROR
    END SELECT
    FUNCTION = nRet
END FUNCTION

//And to communicate with the plugin.dll, the main EXE uses this structure type:
 
TYPE BBPLUGIN                  '// 256 bytes
    Msg         AS LONG       '// The plugin's message (see above constant list).
    ParentWindow AS LONG       '// The parent window handle.
    DC          AS LONG       '// The parent window DC (while in play mode).
    RC          AS LONG       '// The parent OpenGL RC (while in play mode).
    Lpeak       AS WORD       '// The left audio channel peak value (while in play mode).
    Rpeak       AS WORD       '// The right audio channel peak value (while in play mode).
    Title       AS ASCIIZ * 32 '// Plugin's name or title.
    Author      AS ASCIIZ * 64 '// Plugin's author name.
    Version     AS DWORD      '// LOWRD major, HIWRD minor.
    RenderTo    AS LONG       '// %BBP_GDIPLUS, %BBP_OPENGL, %BBP_DIRECTX.
    BackARGB    AS LONG       '// Default ARGB color background.
    FFTdata     AS DWORD      '// DWORD pointer to the FFT() AS SINGLE array.
    FFTsize     AS WORD       '// Size of the FFT array.
 
    WinMsg      AS LONG       '// True Windows message.
    wParam      AS LONG       '// wParam
    lParam      AS LONG       '// lParam
   
    WIMdata     AS DWORD      '// DWORD pointer to the wave MM_WIM_DATA.
    MediaLength AS DWORD      '// Media length.
    MediaPos    AS DWORD      '// Media pos.
 
    Reserved    AS ASCIIZ * 98 '// Reserved for future extension.
END TYPE
 
//The name of the procedure being used in the main EXE to communicate with the active plugin is BBP_Plugin (BYREF BBP AS BBBPLUGIN)
 
//In BassBox, all the plugins are closely tied to the BassChannelGetLevel API to perform real time audio visualization.
Übersetzung ansicht kein problem (soweit fertig)
Nur wo gehts nach außen und wo wird was empfangen...(von der Winproc abgesehen)

gruss Emil
  Mit Zitat antworten Zitat