Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 3.62 KB | None | 0 0
  1. Global Const $AUX_MAPPER = -1
  2. ; AUXCAPS.wTechnology
  3. Global Const $AUXCAPS_AUXIN = 0x2
  4. Global Const $AUXCAPS_CDAUDIO = 0x1
  5. Global Const $AUXCAPS_MASTER = 0x8
  6. Global Const $AUXCAPS_MIC = 0x4
  7. Global Const $AUXCAPS_MIDI = 0x40
  8. Global Const $AUXCAPS_PCSPEAKER = 0x10
  9. Global Const $AUXCAPS_WAVE = 0x20
  10. ; AUXCAPS.dwSupport
  11. Global Const $AUXCAPS_LRVOLUME = 0x2
  12. Global Const $AUXCAPS_VOLUME = 0x1
  13. ; AUXCAPS.wMid
  14. Global Const $MM_ANTEX = 31
  15. Global Const $MM_APPS = 42
  16. Global Const $MM_APT = 56
  17. Global Const $MM_ARTISOFT = 20
  18. Global Const $MM_AST = 64
  19. Global Const $MM_ATI = 27
  20. ; ... und so weiter, für Details siehe AUXCAPS Struktur Deklaration
  21.  
  22. Local $tagAUXCAPS = 'int wMid;int wPid;long vDriverVersion;str szPname;int wTechnology;long dwSupport;'
  23. Local $tAUXCAPS, $Anzahl
  24.  
  25. $Anzahl = auxGetNumDevs() ; <== erster ist ID1. zweiter ist ID2 usw.
  26. If $Anzahl = 0 Then Exit MsgBox(0, '', 'Keine Audiogeräte gefunden')
  27.  
  28. For $i = 1 To $Anzahl
  29.     $tAUXCAPS = DllStructCreate($tagAUXCAPS) ; leere Struktur zur Aufnahme der Daten erstellen
  30.     auxGetDevCaps($i, $tAUXCAPS)             ; Daten des Aux-ID-Gerätes in die Struktur eintragen
  31.     If @error Then ContinueLoop
  32.     WriteInfo_Device($tAUXCAPS, $i)          ; Daten in Console ausgeben
  33. Next
  34.  
  35.  
  36.  
  37. Func auxGetNumDevs()
  38.     Local $ret = DllCall("winmm.dll", "long", "auxGetNumDevs")
  39.     If Not IsArray($ret) Or @error Then
  40.         Return SetError(1,0,-1)
  41.     Else
  42.         Return $ret[0]
  43.     EndIf
  44. EndFunc
  45.  
  46. Func auxGetDevCaps($uDeviceID, $tAUXCAPS)
  47.     Local $ret = DllCall("winmm.dll", "long", "auxGetDevCapsA", "long", $uDeviceID, "ptr", DllStructGetPtr($tAUXCAPS), "long", DllStructGetSize($tAUXCAPS))
  48.     If Not IsArray($ret) Or @error Then
  49.         Return SetError(1,0,-1)
  50.     Else
  51.         Return $ret[0]
  52.     EndIf
  53. EndFunc
  54.  
  55. Func WriteInfo_Device($tAUXCAPS, $DeviceIndex)
  56.     Dim $MajorVer, $MinorVer
  57.     ConsoleWrite( _
  58.         "Geräte Index: " & $DeviceIndex & @CRLF & _
  59.         "Geräte Name: " & DllStructGetData($tAUXCAPS, "szPname") & @CRLF & _
  60.         "Geräte Hersteller: " & GetManufacturerName(DllStructGetData($tAUXCAPS, "wMid")) & @CRLF)
  61.     $MajorVer = BitOR(DllStructGetData($tAUXCAPS, "vDriverVersion"), 0xFF00) / 0x100
  62.     $MinorVer = BitOR(DllStructGetData($tAUXCAPS, "vDriverVersion"), 0xFF)
  63.     ConsoleWrite("Treiber Version: " & $MajorVer & "." & $MinorVer & @CRLF)
  64.  
  65.     If DllStructGetData($tAUXCAPS, "dwSupport") = BitOR($AUXCAPS_LRVOLUME,$AUXCAPS_VOLUME) Then
  66.         ConsoleWrite("Kanäle: 2 (Stereo)" & @CRLF)
  67.     ElseIf DllStructGetData($tAUXCAPS, "dwSupport") = $AUXCAPS_VOLUME Then
  68.         ConsoleWrite("Kanäle: 1 (Mono)" & @CRLF)
  69.     EndIf
  70.  
  71.     Switch DllStructGetData($tAUXCAPS, "wTechnology")
  72.         Case $AUXCAPS_AUXIN
  73.             ConsoleWrite("Gerätetyp: AUX IN" & @CRLF)
  74.         Case $AUXCAPS_CDAUDIO
  75.             ConsoleWrite("Gerätetyp: Audio CD" & @CRLF)
  76.         Case $AUXCAPS_MASTER
  77.             ConsoleWrite("Gerätetyp: Master" & @CRLF)
  78.         Case $AUXCAPS_MIC
  79.             ConsoleWrite("Gerätetyp: Microfon" & @CRLF)
  80.         Case $AUXCAPS_MIDI
  81.             ConsoleWrite("Gerätetyp: Midi" & @CRLF)
  82.         Case $AUXCAPS_PCSPEAKER
  83.             ConsoleWrite("Gerätetyp: PC Lautsprecher" & @CRLF)
  84.         Case $AUXCAPS_WAVE
  85.             ConsoleWrite("Gerätetyp: Wave" & @CRLF)
  86.         Case Else
  87.             ConsoleWrite("Gerätetyp: Unbekannt" & @CRLF)
  88.     EndSwitch
  89.     ConsoleWrite(@CRLF)
  90. EndFunc
  91.  
  92. Func GetManufacturerName($ManufacturerID)
  93.     Switch $ManufacturerID
  94.         Case $MM_ANTEX
  95.             Return "Antex Electronics Corporation"
  96.         Case $MM_APPS
  97.             Return "APPS Software"
  98.         Case $MM_ARTISOFT
  99.             Return "Artisoft, Inc."
  100.         Case $MM_AST
  101.             Return "AST Research, Inc."
  102.         Case $MM_ATI
  103.             Return "ATI Technologies, Inc."
  104.         ; ... und so weiter, für Details siehe AUXCAPS Struktur Deklaration
  105.         Case Else
  106.             Return "Unbekannt (ID = " & $ManufacturerID & ")"
  107.     EndSwitch
  108. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement