3
' Copyright(C) 2011-2014, Michał Głowienka aka eloaders <eloaders@linux.pl>
5
' This program is free software; you can redistribute it and/or modify
6
' it under the terms of the GNU General Public License as published by
7
' the Free Software Foundation; either version 3 of the License, or
8
' (at your option) any later version.
10
' This program is distributed in the hope that it will be useful,
11
' but WITHOUT ANY WARRANTY; without even the implied warranty of
12
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
' GNU General Public License for more details.
15
' You should have received a copy of the GNU General Public License
16
' along with this program. If not, see <http://www.gnu.org/licenses/>.
18
Public Logs As New Logger
19
Public Version As String
20
Public ASOUND_ID As String
21
Public ASOUND_CODEC As String
22
Public ASOUND_ALSADV As String
23
Public ASOUND_INPUT As String
25
Public hwdep As String
27
Public sound_cards As String
30
Dim ASOUND_CARDS As String
31
Dim ASOUND_CARDS_LIST As String[]
34
Shell "grep \"\\[\" /proc/asound/cards | cut -d \":\" -f 2" Wait To ASOUND_CARDS
35
ASOUND_CARDS_LIST = Split(ASOUND_CARDS, "\n", "%%")
36
For i = 1 To ASOUND_CARDS_LIST.Count - 1
37
If ASOUND_CARDS_LIST[i] = Null Then
38
ASOUND_CARDS_LIST.Delete(i)
41
Finfosys.ComboBox6.List = ASOUND_CARDS_LIST
42
Finfosys.ComboBox6.Index = 0
46
Public Sub _get_informations()
47
Dim ASOUND_INPUT As String
48
Dim ASOUND_INPUT_LIST_NAME As String
49
Dim ASOUND_INPUT_LIST As String[]
51
Try ASOUND_ID = File.Load("/proc/asound/card" & Finfosys.ComboBox6.Index & "/id")
52
Try ASOUND_ALSADV = File.Load("/proc/asound/version")
53
ASOUND_ID = Replace(ASOUND_ID, "\n", "")
54
Shell "grep \"Codec:\" /proc/asound/" & ASOUND_ID & "/codec*" Wait To ASOUND_CODEC
55
Finfosys.Label73.Text = Replace(ASOUND_CODEC, "\n", "") & " "
56
Finfosys.Label9.Text = Replace(Replace(ASOUND_ALSADV, "\n", ""), "Advanced Linux Sound Architecture", "ALSA")
57
Shell "ls /sys/class/sound/card" & Finfosys.ComboBox6.Index & " | grep input | sort" Wait To ASOUND_INPUT
58
ASOUND_INPUT_LIST = Split(ASOUND_INPUT, "\n", "%%")
60
For i = 1 To ASOUND_INPUT_LIST.Count - 1
61
If ASOUND_INPUT_LIST[i] = Null Then
62
ASOUND_INPUT_LIST.Delete(i)
65
Finfosys.ComboBox9.List = ASOUND_INPUT_LIST
66
Finfosys.ComboBox9.Index = 0
68
'file:///sys/class/sound/card0/input6/name
72
Public Sub _INPUT_NAME()
73
Try Finfosys.Label78.text = Replace(File.Load("/sys/class/sound/card" & Finfosys.ComboBox6.Index & "/" & Finfosys.ComboBox9.Text & "/name"), "\n", "")
74
Try Finfosys.TextArea18.text = File.Load("/proc/asound/card" & Finfosys.ComboBox6.Index & "/codec#0")