Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Global Const $AUX_MAPPER = -1
- ; AUXCAPS.wTechnology
- Global Const $AUXCAPS_AUXIN = 0x2
- Global Const $AUXCAPS_CDAUDIO = 0x1
- Global Const $AUXCAPS_MASTER = 0x8
- Global Const $AUXCAPS_MIC = 0x4
- Global Const $AUXCAPS_MIDI = 0x40
- Global Const $AUXCAPS_PCSPEAKER = 0x10
- Global Const $AUXCAPS_WAVE = 0x20
- ; AUXCAPS.dwSupport
- Global Const $AUXCAPS_LRVOLUME = 0x2
- Global Const $AUXCAPS_VOLUME = 0x1
- ; AUXCAPS.wMid
- Global Const $MM_ANTEX = 31
- Global Const $MM_APPS = 42
- Global Const $MM_APT = 56
- Global Const $MM_ARTISOFT = 20
- Global Const $MM_AST = 64
- Global Const $MM_ATI = 27
- ; ... und so weiter, für Details siehe AUXCAPS Struktur Deklaration
- Local $tagAUXCAPS = 'int wMid;int wPid;long vDriverVersion;str szPname;int wTechnology;long dwSupport;'
- Local $tAUXCAPS, $Anzahl
- $Anzahl = auxGetNumDevs() ; <== erster ist ID1. zweiter ist ID2 usw.
- If $Anzahl = 0 Then Exit MsgBox(0, '', 'Keine Audiogeräte gefunden')
- For $i = 1 To $Anzahl
- $tAUXCAPS = DllStructCreate($tagAUXCAPS) ; leere Struktur zur Aufnahme der Daten erstellen
- auxGetDevCaps($i, $tAUXCAPS) ; Daten des Aux-ID-Gerätes in die Struktur eintragen
- If @error Then ContinueLoop
- WriteInfo_Device($tAUXCAPS, $i) ; Daten in Console ausgeben
- Next
- Func auxGetNumDevs()
- Local $ret = DllCall("winmm.dll", "long", "auxGetNumDevs")
- If Not IsArray($ret) Or @error Then
- Return SetError(1,0,-1)
- Else
- Return $ret[0]
- EndIf
- EndFunc
- Func auxGetDevCaps($uDeviceID, $tAUXCAPS)
- Local $ret = DllCall("winmm.dll", "long", "auxGetDevCapsA", "long", $uDeviceID, "ptr", DllStructGetPtr($tAUXCAPS), "long", DllStructGetSize($tAUXCAPS))
- If Not IsArray($ret) Or @error Then
- Return SetError(1,0,-1)
- Else
- Return $ret[0]
- EndIf
- EndFunc
- Func WriteInfo_Device($tAUXCAPS, $DeviceIndex)
- Dim $MajorVer, $MinorVer
- ConsoleWrite( _
- "Geräte Index: " & $DeviceIndex & @CRLF & _
- "Geräte Name: " & DllStructGetData($tAUXCAPS, "szPname") & @CRLF & _
- "Geräte Hersteller: " & GetManufacturerName(DllStructGetData($tAUXCAPS, "wMid")) & @CRLF)
- $MajorVer = BitOR(DllStructGetData($tAUXCAPS, "vDriverVersion"), 0xFF00) / 0x100
- $MinorVer = BitOR(DllStructGetData($tAUXCAPS, "vDriverVersion"), 0xFF)
- ConsoleWrite("Treiber Version: " & $MajorVer & "." & $MinorVer & @CRLF)
- If DllStructGetData($tAUXCAPS, "dwSupport") = BitOR($AUXCAPS_LRVOLUME,$AUXCAPS_VOLUME) Then
- ConsoleWrite("Kanäle: 2 (Stereo)" & @CRLF)
- ElseIf DllStructGetData($tAUXCAPS, "dwSupport") = $AUXCAPS_VOLUME Then
- ConsoleWrite("Kanäle: 1 (Mono)" & @CRLF)
- EndIf
- Switch DllStructGetData($tAUXCAPS, "wTechnology")
- Case $AUXCAPS_AUXIN
- ConsoleWrite("Gerätetyp: AUX IN" & @CRLF)
- Case $AUXCAPS_CDAUDIO
- ConsoleWrite("Gerätetyp: Audio CD" & @CRLF)
- Case $AUXCAPS_MASTER
- ConsoleWrite("Gerätetyp: Master" & @CRLF)
- Case $AUXCAPS_MIC
- ConsoleWrite("Gerätetyp: Microfon" & @CRLF)
- Case $AUXCAPS_MIDI
- ConsoleWrite("Gerätetyp: Midi" & @CRLF)
- Case $AUXCAPS_PCSPEAKER
- ConsoleWrite("Gerätetyp: PC Lautsprecher" & @CRLF)
- Case $AUXCAPS_WAVE
- ConsoleWrite("Gerätetyp: Wave" & @CRLF)
- Case Else
- ConsoleWrite("Gerätetyp: Unbekannt" & @CRLF)
- EndSwitch
- ConsoleWrite(@CRLF)
- EndFunc
- Func GetManufacturerName($ManufacturerID)
- Switch $ManufacturerID
- Case $MM_ANTEX
- Return "Antex Electronics Corporation"
- Case $MM_APPS
- Return "APPS Software"
- Case $MM_ARTISOFT
- Return "Artisoft, Inc."
- Case $MM_AST
- Return "AST Research, Inc."
- Case $MM_ATI
- Return "ATI Technologies, Inc."
- ; ... und so weiter, für Details siehe AUXCAPS Struktur Deklaration
- Case Else
- Return "Unbekannt (ID = " & $ManufacturerID & ")"
- EndSwitch
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement