Browse Source

Render: Gracefully handle systems without JACK, show error dialog

tags/v0.9.0
falkTX 13 years ago
parent
commit
8ccaca0d48
3 changed files with 11 additions and 2 deletions
  1. +1
    -0
      src/jacklib.py
  2. +4
    -1
      src/jacklib_helpers.py
  3. +6
    -1
      src/render.py

+ 1
- 0
src/jacklib.py View File

@@ -30,6 +30,7 @@ try:
jacklib = cdll.LoadLibrary("libjack.so.0") jacklib = cdll.LoadLibrary("libjack.so.0")
except: except:
jacklib = None jacklib = None
raise ImportError("JACK not available in this system")


# JACK2 test # JACK2 test
try: try:


+ 4
- 1
src/jacklib_helpers.py View File

@@ -16,7 +16,10 @@
# #
# For a full copy of the GNU General Public License see the COPYING file # For a full copy of the GNU General Public License see the COPYING file


import jacklib
try:
import jacklib
except ImportError:
jacklib = None


def get_jack_status_error_string(c_status): def get_jack_status_error_string(c_status):
status = c_status.value status = c_status.value


+ 6
- 1
src/render.py View File

@@ -305,6 +305,11 @@ if __name__ == '__main__':
app.setOrganizationName("Cadence") app.setOrganizationName("Cadence")
app.setWindowIcon(QIcon(":/scalable/cadence.svg")) app.setWindowIcon(QIcon(":/scalable/cadence.svg"))


if not jacklib:
QMessageBox.critical(None, app.translate("RenderW", "Error"), app.translate("RenderW",
"JACK is not available in this system, cannot use this application."))
sys.exit(1)

for iPATH in PATH: for iPATH in PATH:
if os.path.exists(os.path.join(iPATH, "jack_capture")): if os.path.exists(os.path.join(iPATH, "jack_capture")):
break break
@@ -312,7 +317,7 @@ if __name__ == '__main__':
QMessageBox.critical(None, app.translate("RenderW", "Error"), app.translate("RenderW", QMessageBox.critical(None, app.translate("RenderW", "Error"), app.translate("RenderW",
"The 'jack_capture' application is not available.\n" "The 'jack_capture' application is not available.\n"
"Is not possible to render without it!")) "Is not possible to render without it!"))
sys.exit(1)
sys.exit(2)


jackStatus = jacklib.jack_status_t(0) jackStatus = jacklib.jack_status_t(0)
jackClient = jacklib.client_open("Render", jacklib.JackNoStartServer, jacklib.pointer(jackStatus)) jackClient = jacklib.client_open("Render", jacklib.JackNoStartServer, jacklib.pointer(jackStatus))


Loading…
Cancel
Save