Browse Source

verbose output for jack test on start

master
Nils 3 years ago
parent
commit
b6ef30b048
  1. 18
      template/start.py

18
template/start.py

@ -210,11 +210,13 @@ def _is_jack_running():
"""Check for JACK"""
import ctypes
import os
silent = os.open(os.devnull, os.O_WRONLY)
stdout = os.dup(1)
stderr = os.dup(2)
os.dup2(silent, 1) #stdout
os.dup2(silent, 2) #stderr
if not args.verbose:
silent = os.open(os.devnull, os.O_WRONLY)
stdout = os.dup(1)
stderr = os.dup(2)
os.dup2(silent, 1) #stdout
os.dup2(silent, 2) #stderr
cjack = ctypes.cdll.LoadLibrary("libjack.so.0")
class jack_client_t(ctypes.Structure):
_fields_ = []
@ -226,10 +228,12 @@ def _is_jack_running():
except ValueError: #NULL pointer access
ret = False
cjack.jack_client_close(ctypesJackClient)
os.dup2(stdout, 1) #stdout
os.dup2(stderr, 2) #stderr
if not args.verbose:
os.dup2(stdout, 1) #stdout
os.dup2(stderr, 2) #stderr
return ret
def checkJackOrExit(mute, prettyName):
import sys
if not mute and (not _is_jack_running()):

Loading…
Cancel
Save