Audio plugin host https://kx.studio/carla
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.

110 lines
2.4KB

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