Collection of tools useful for audio production
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.3KB

  1. #!/bin/bash
  2. # Script to start Carla bridges
  3. INSTALL_PREFIX="X-PREFIX-X"
  4. CADENCE_PREFIX="$INSTALL_PREFIX"/lib/cadence
  5. # ----------------------------------------------------------------------
  6. # Check for enough arguments
  7. if [ "$3"x == ""x ]; then
  8. echo "usage: $0 [arch] [mode] [filename] [label/uri]
  9. Possible archs:
  10. - \"posix32\"
  11. - \"posix64\"
  12. - \"win32\"
  13. - \"win64\"
  14. Possible modes:
  15. - \"ladspa\"
  16. - \"dssi\"
  17. - \"lv2\"
  18. - \"vst\"
  19. Examples:
  20. $0 posix64 lv2 \"/usr/lib/lv2/calf/\" \"http://calf.sourceforge.net/plugins/Compressor\"
  21. "
  22. exit
  23. fi
  24. # ----------------------------------------------------------------------
  25. # Set client name (from environment)
  26. if [ "$CARLA_CLIENT_NAME"x == ""x ]; then
  27. CARLA_CLIENT_NAME="(none)"
  28. fi
  29. # ----------------------------------------------------------------------
  30. # Set variables
  31. RUN_ARCH="$1"
  32. RUN_MODE="$2"
  33. RUN_FILE="$3"
  34. RUN_LABEL="$4"
  35. # ----------------------------------------------------------------------
  36. # Fix arch for windows bridges
  37. if [ $RUN_ARCH == "win32" ]; then
  38. RUN_ARCH="win32.exe"
  39. fi
  40. if [ $RUN_ARCH == "win64" ]; then
  41. RUN_ARCH="win64.exe"
  42. fi
  43. # ----------------------------------------------------------------------
  44. # Check for existing cadence folder
  45. if [ ! -d $CADENCE_PREFIX ]; then
  46. echo "$0: Cadence folder non-existing, is it installed?"
  47. exit
  48. fi
  49. # ----------------------------------------------------------------------
  50. # Check for existing arch binary
  51. CARLA_EXEC="$CADENCE_PREFIX/carla-bridge-$RUN_ARCH"
  52. if [ ! -f $CARLA_EXEC ]; then
  53. echo "$0: Invalid arch (may not be installed)"
  54. exit
  55. fi
  56. # ----------------------------------------------------------------------
  57. # Check mode
  58. if [ "$RUN_MODE"x == "ladspa"x ]; then
  59. if [ "$RUN_LABEL"x == ""x ]; then
  60. echo "$0: LADSPA needs label"
  61. exit
  62. fi
  63. RUN_MODE="DSSI"
  64. elif [ "$RUN_MODE"x == "dssi"x ]; then
  65. if [ "$RUN_LABEL"x == ""x ]; then
  66. echo "$0: DSSI needs label"
  67. exit
  68. fi
  69. RUN_MODE="DSSI"
  70. elif [ "$RUN_MODE"x == "lv2"x ]; then
  71. if [ "$RUN_LABEL"x == ""x ]; then
  72. echo "$0: LV2 needs uri"
  73. exit
  74. fi
  75. RUN_MODE="LV2"
  76. elif [ "$RUN_MODE"x == "vst"x ]; then
  77. RUN_MODE="VST"
  78. else
  79. echo "$0: Invalid mode"
  80. exit
  81. fi
  82. # ----------------------------------------------------------------------
  83. # Exec
  84. exec $CARLA_EXEC "null" "$RUN_MODE" "$RUN_FILE" "$CARLA_CLIENT_NAME" "$RUN_LABEL"