aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordvs12024-10-14 22:55:03 +1000
committerdvs12024-10-14 22:55:03 +1000
commit959f12c0e7cc5b0a9efc2bd80e38ce09347ce517 (patch)
treea706ed631456c0b054eba4e202f0a9c2b79270c3
parentUpdate README.md to match the code's help text. (diff)
downloadJackOnAllDevices-959f12c0e7cc5b0a9efc2bd80e38ce09347ce517.zip
JackOnAllDevices-959f12c0e7cc5b0a9efc2bd80e38ce09347ce517.tar.gz
JackOnAllDevices-959f12c0e7cc5b0a9efc2bd80e38ce09347ce517.tar.bz2
JackOnAllDevices-959f12c0e7cc5b0a9efc2bd80e38ce09347ce517.tar.xz
Rearrange code.
-rwxr-xr-xaataaj.lua158
1 files changed, 79 insertions, 79 deletions
diff --git a/aataaj.lua b/aataaj.lua
index 511491a..5a20a53 100755
--- a/aataaj.lua
+++ b/aataaj.lua
@@ -82,85 +82,6 @@ NOTE - Seems both ALSA and JACK are per user. So you need to run
82]] 82]]
83 83
84 84
85local args = {...}
86if 0 ~= #args then
87-- for i,a in pairs(args) do
88-- print('Argument ' .. i .. ' = ' .. a)
89-- end
90
91 if 'start' == args[1] then
92 elseif 'stop' == args[1] then
93 APT.exe("killall -TERM qsynth"):Do()
94 APT.exe("a2j_control --stop"):Do()
95 APT.exe("sleep 2"):Do()
96 APT.exe("a2j_control --exit"):Do()
97 APT.exe("sleep 2"):Do()
98 APT.exe("killall -TERM alsa_out"):Do()
99 APT.exe("killall -TERM alsa_in"):Do()
100 APT.exe("killall -TERM zita-a2j"):Do()
101 APT.exe("killall -TERM zita-j2a"):Do()
102 APT.exe("killall -TERM aseqjoy"):Do()
103 APT.exe("killall -TERM jack-plumbing"):Do()
104 APT.exe("sleep 2"):Do()
105 APT.exe("jack_control stop"):Do()
106 APT.exe("sleep 2"):Do()
107 APT.exe("jack_control exit"):Do()
108 APT.exe("sleep 2"):Do()
109 --APT.exe("a2j_control --stop; a2j_control --exit"):Do()
110 --APT.exe("sleep 2"):Do()
111 APT.exe("killall -TERM jmcore"):Do()
112 APT.exe("pkill -TERM jackdbus; pkill -TERM a2jmidid"):Do()
113 APT.exe("killall -TERM a2jmidid"):Do()
114 APT.exe("killall -KILL jackdbus"):Do()
115 APT.exe("sleep 2"):Do()
116 APT.exe("killall -KILL a2jmidid"):Do()
117 APT.exe("pkill -KILL jackdbus; pkill -KILL a2jmidid"):Do()
118 APT.exe("sleep 2"):Do()
119 APT.exe("killall -KILL a2jmidid"):Do()
120 APT.exe("killall -KILL jackdbus"):Do()
121 APT.exe("sleep 2"):Do()
122 APT.exe("killall -KILL a2jmidid"):Do()
123 APT.exe("killall -KILL jackdbus"):Do()
124 APT.exe("sleep 2"):Do()
125 APT.exe("pkill -KILL jackdbus; pkill -KILL a2jmidid"):Do()
126 APT.exe("killall -TERM qjackctl"):Do()
127
128 -- Catia is python, and no easy way to kill it.
129 APT.exe("ps auxw | grep python"):Do()
130 return(0)
131 elseif 'JACK' == args[1] then
132 elseif 'restart' == args[1] then args[1] = 'start'
133 elseif 'force-reload' == args[1] then args[1] = 'start'
134 elseif 'status' == args[1] then
135 return(0)
136 elseif 'help' == args[1] then
137 print(Help)
138 return(0)
139 elseif '--help' == args[1] then
140 print(Help)
141 return(0)
142 else
143 print("Usage: /etc/init.d/aataaj.lua {start|stop|restart|force-reload|status}")
144 return(1)
145 end
146else
147 print("Usage: /etc/init.d/aataaj.lua {help|start|stop|restart|force-reload|status|JACK}")
148 return(1)
149end
150
151
152
153-- CHANGE these to suit.
154local asoundrcPath = '/var/lib/aataaj'
155local asoundrc = 'asoundrc'
156local GUI = 'qjackctl'
157--local GUI = 'catia'
158local alias = {
159-- {name='Screen', dev='HDMI9'},
160 }
161
162
163
164 85
165-- This APT stuff was copied from apt-panopticon. 86-- This APT stuff was copied from apt-panopticon.
166local APT = {} 87local APT = {}
@@ -271,6 +192,85 @@ end
271 192
272 193
273 194
195local args = {...}
196if 0 ~= #args then
197-- for i,a in pairs(args) do
198-- print('Argument ' .. i .. ' = ' .. a)
199-- end
200
201 if 'start' == args[1] then
202 elseif 'stop' == args[1] then
203 APT.exe("killall -TERM qsynth"):Do()
204 APT.exe("a2j_control --stop"):Do()
205 APT.exe("sleep 2"):Do()
206 APT.exe("a2j_control --exit"):Do()
207 APT.exe("sleep 2"):Do()
208 APT.exe("killall -TERM alsa_out"):Do()
209 APT.exe("killall -TERM alsa_in"):Do()
210 APT.exe("killall -TERM zita-a2j"):Do()
211 APT.exe("killall -TERM zita-j2a"):Do()
212 APT.exe("killall -TERM aseqjoy"):Do()
213 APT.exe("killall -TERM jack-plumbing"):Do()
214 APT.exe("sleep 2"):Do()
215 APT.exe("jack_control stop"):Do()
216 APT.exe("sleep 2"):Do()
217 APT.exe("jack_control exit"):Do()
218 APT.exe("sleep 2"):Do()
219 --APT.exe("a2j_control --stop; a2j_control --exit"):Do()
220 --APT.exe("sleep 2"):Do()
221 APT.exe("killall -TERM jmcore"):Do()
222 APT.exe("pkill -TERM jackdbus; pkill -TERM a2jmidid"):Do()
223 APT.exe("killall -TERM a2jmidid"):Do()
224 APT.exe("killall -KILL jackdbus"):Do()
225 APT.exe("sleep 2"):Do()
226 APT.exe("killall -KILL a2jmidid"):Do()
227 APT.exe("pkill -KILL jackdbus; pkill -KILL a2jmidid"):Do()
228 APT.exe("sleep 2"):Do()
229 APT.exe("killall -KILL a2jmidid"):Do()
230 APT.exe("killall -KILL jackdbus"):Do()
231 APT.exe("sleep 2"):Do()
232 APT.exe("killall -KILL a2jmidid"):Do()
233 APT.exe("killall -KILL jackdbus"):Do()
234 APT.exe("sleep 2"):Do()
235 APT.exe("pkill -KILL jackdbus; pkill -KILL a2jmidid"):Do()
236 APT.exe("killall -TERM qjackctl"):Do()
237
238 -- Catia is python, and no easy way to kill it.
239 APT.exe("ps auxw | grep python"):Do()
240 return(0)
241 elseif 'JACK' == args[1] then
242 elseif 'restart' == args[1] then args[1] = 'start'
243 elseif 'force-reload' == args[1] then args[1] = 'start'
244 elseif 'status' == args[1] then
245 return(0)
246 elseif 'help' == args[1] then
247 print(Help)
248 return(0)
249 elseif '--help' == args[1] then
250 print(Help)
251 return(0)
252 else
253 print("Usage: /etc/init.d/aataaj.lua {start|stop|restart|force-reload|status}")
254 return(1)
255 end
256else
257 print("Usage: /etc/init.d/aataaj.lua {help|start|stop|restart|force-reload|status|JACK}")
258 return(1)
259end
260
261
262
263
264-- CHANGE these to suit.
265local asoundrcPath = '/var/lib/aataaj'
266local asoundrc = 'asoundrc'
267--local GUI = 'qjackctl'
268local GUI = 'catia'
269local alias = {
270 {name='Screen', dev='HDMI9'},
271 }
272
273
274local Cards = {} 274local Cards = {}
275 275
276print('Scanning for audio devices.') 276print('Scanning for audio devices.')