AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein Delphi ich brauche hilfe mit Record’s

ich brauche hilfe mit Record’s

Ein Thema von Wishmaster · begonnen am 26. Mär 2013 · letzter Beitrag vom 27. Mär 2013
 
Wishmaster

Registriert seit: 14. Sep 2002
Ort: Steinbach, MB, Canada
301 Beiträge
 
Delphi XE2 Architect
 
#1

ich brauche hilfe mit Record’s

  Alt 26. Mär 2013, 06:42
Hi, ich brauche hilfe mit Record’s. genauer gesagt, ich versuche eine liste aus eine dll zu exportieren
allerding wird einer der eintrage nicht richtig angezeig,


Delphi-Quellcode:
type
  TDeviceInfo = record
   DeviceName : PWideChar;
   DeviceID : PInteger;
  end;

   PDeviceInfo = Array of TDeviceInfo;
das ist der dll part
Delphi-Quellcode:
function TPlayer.Get_Device_Name(var DeviceInfo : PDeviceInfo; Driver : TDriver_Type): Boolean;
var
  WAS_Info : BASS_WASAPI_DEVICEINFO;
  DS_Info : BASS_DEVICEINFO;
  Device, DefDevice : Integer;
begin
 case Driver of
   Driver_DirectSound:
    begin
     try
       SetLength(DeviceInfo, 1);
       Device:= 0;
      while (BASS_GetDeviceInfo(Device, DS_Info) <> false) do
       begin
        DeviceInfo[Device].DeviceName:= PWideChar(Widestring(DS_Info.name));
        Inc(Device);
       end;

       Result:= true;
     except
      Result:= false;
     end;
    end;
   Driver_WASAPI:
    begin
     // ToDo
    end;
   Driver_ASIO:
    begin
      // ToDo
    end;

 end; //case end;
end;


function Player_Get_Device_Name(Obj : Pointer; var DeviceInfo : PDeviceInfo; DriverType : TDriver_Type) : Boolean; export; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
begin
 try
   Result:= TPlayer(Obj).Get_Device_Name(DeviceInfo, DriverType);
 except
  Result:= false;
 end;
end;


exports
...
 Player_Get_Device_Name
...

hier benutze ich Record's und (dll)
Code:
No sound
Digital Audio (S/PDIF) (ASUS XONAR PHOEBUS Audio Device)  << falsch
Speakers (ASUS XONAR PHOEBUS Audio Device)
Digital Audio (S/PDIF) (ASUS XONAR PHOEBUS Audio Device)
Here I use a TStringlist which gives me back the correct result
Code:
No sound
Headset(SB Tactic(3D) Wrath Wireless)                      << Richtig
Speakers (ASUS XONAR PHOEBUS Audio Device)
Digital Audio (S/PDIF) (ASUS XONAR PHOEBUS Audio Device)


and in this way I retrieve the data

Delphi-Quellcode:

var Obj1 : Pointer;
...
var List : TStrings;
    Rec : PDeviceInfo;
    i : integer;
begin
  if Load_PlayerDll(PlayerDLL) then
   begin
    Obj1:= Player_Create(Application.Handle, '');
    Player_Set_Driver(Obj1, Driver_DirectSound);
    Player_Init_Device(Obj1, -1, 44100, false);

    list := TStringlist.Create;

    Player_Get_Device_Name(Obj1, Rec, Driver_DirectSound);
   for I := 0 to SizeOf(Rec) do
    begin
     List.Add(PWideChar(Rec[i].DeviceName));
    end;

    Devicelist.Items.Assign(List);
    list.Free;
   end;

vielleicht habt ihr ja eine bessere idee wie man das lösen könnte
  Mit Zitat antworten Zitat
 

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:25 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz