~eloaders/i-nex/I-Nex

« back to all changes in this revision

Viewing changes to src/i-nex/.src/Asound_Drives.module

  • Committer: eloaders
  • Date: 2014-07-15 16:31:30 UTC
  • Revision ID: git-v1:64e92b39f32ea7a292985dee67d4c6de1333f9fa
Move src to I-Nex

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
' Gambas module file
2
 
 
3
 
' Copyright(C) 2011-2014, Michał Głowienka aka eloaders <eloaders@linux.pl>
4
 
'
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.
9
 
'
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.
14
 
'
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/>.
17
 
 
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
24
 
Public Id As String
25
 
Public hwdep As String
26
 
Public pcm As String
27
 
Public sound_cards As String
28
 
 
29
 
Public Sub _inits()
30
 
  Dim ASOUND_CARDS As String
31
 
  Dim ASOUND_CARDS_LIST As String[]
32
 
  Dim i As Integer
33
 
  
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)
39
 
   Endif
40
 
  Next
41
 
   Finfosys.ComboBox6.List = ASOUND_CARDS_LIST
42
 
   Finfosys.ComboBox6.Index = 0
43
 
   _get_informations()
44
 
End
45
 
 
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[]
50
 
   Dim i As Integer
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", "%%")
59
 
   
60
 
   For i = 1 To ASOUND_INPUT_LIST.Count - 1
61
 
    If ASOUND_INPUT_LIST[i] = Null Then
62
 
       ASOUND_INPUT_LIST.Delete(i)
63
 
    Endif
64
 
   Next
65
 
   Finfosys.ComboBox9.List = ASOUND_INPUT_LIST
66
 
   Finfosys.ComboBox9.Index = 0
67
 
   'ComboBox9
68
 
   'file:///sys/class/sound/card0/input6/name
69
 
   
70
 
End
71
 
 
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")
75
 
 
76
 
End