' Gambas module file

Public Version As String
Public Modules As String
Public Devices As String
Public Codec As String
Public Cards As String
Public Id As String
Public hwdep As String
Public pcm As String
Public sound_cards As String

Public Sub _init()
 Dim ListAllDiscs, risultato As String
  Dim righe As New String[]
  Dim count As Integer
  Dim riga As New String[]
  Dim lista As New String[]
  Debug "Add Drives to ComboBox.."
  Shell "ls /proc/asound | grep card[0-9]" To ListAllDiscs
  righe = Split(ListAllDiscs, "\n", "%%", True)
  For count = 0 To righe.Max
  riga = Split(righe[count], " ", "%%", True)
  risultato = Replace(riga[0], " ", "")
  lista.add(risultato)
  Next
  Finfosys.ComboBox6.List = lista
  Finfosys.ComboBox6.Index = 0
  _get_informations()
End

Public Sub _get_informations()
 
 Shell "lspci | grep 'udio' | cut -d ':' -f 3 | cut -d '(' -f 1" Wait To sound_cards
 Shell "cat /proc/asound/version" Wait To Version
 Shell "cat /proc/asound/modules" Wait To Modules
 Shell "cat /proc/asound/devices" Wait To Devices
 Shell "grep 'Codec:' /proc/asound/" & Finfosys.ComboBox6.Text & "/codec#0 | cut -d ':' -f 2" Wait To Codec
 Shell "cat /proc/asound/" & Finfosys.ComboBox6.Text & "/id" Wait To Id
 Shell "cat /proc/asound/cards" Wait To Cards
 Shell "cat /proc/asound/hwdep" Wait To hwdep
 Shell "cat /proc/asound/pcm" Wait To pcm
 Version = Replace(Version, "\n", "")
 Modules = Replace(modules, "\n", "")
 Codec = Replace(Codec, "\n", "")
 Cards = Replace(Cards, "\n", "")
 Id = Replace(Id, "\n", "")
 hwdep = Replace(hwdep, "\n", "")
 pcm = Replace(pcm, "\n", "")
 'Devices = Replace(Devices, "\n", "")
 
End
