aboutsummaryrefslogtreecommitdiff
path: root/site/udo/host_tools.udo
diff options
context:
space:
mode:
authorRichard <q@1bpm.net>2025-04-13 18:48:02 +0100
committerRichard <q@1bpm.net>2025-04-13 18:48:02 +0100
commit9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22 (patch)
tree291bd79ce340e67affa755a8a6b4f6a83cce93ea /site/udo/host_tools.udo
downloadapps.csound.1bpm.net-9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22.tar.gz
apps.csound.1bpm.net-9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22.tar.bz2
apps.csound.1bpm.net-9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22.zip
initial
Diffstat (limited to 'site/udo/host_tools.udo')
-rwxr-xr-xsite/udo/host_tools.udo69
1 files changed, 69 insertions, 0 deletions
diff --git a/site/udo/host_tools.udo b/site/udo/host_tools.udo
new file mode 100755
index 0000000..012e70d
--- /dev/null
+++ b/site/udo/host_tools.udo
@@ -0,0 +1,69 @@
+#ifndef UDO_HOSTTOOLS
+#define UDO_HOSTTOOLS ##
+
+/*
+ Host system tools for interoperability between windows/linux setups
+
+ This file is part of the SONICS UDO collection by Richard Knight 2021
+ License: GPL-2.0-or-later
+ http://1bpm.net
+*/
+#include "__config__.udo"
+#include "host_platform.udo"
+
+
+/*
+ Get the path to the shared general audio repository with a trailing slash
+ Spath _dir_audio
+
+ Spath the relevant resulting path
+*/
+opcode _dir_audio, S, 0
+ xout (gihost_type == 1) ? gSpath_baseLin : gSpath_baseWin
+endop
+
+
+/*
+ Get a full path of subdirectories in the soundfont directory
+ SfullPath dir_soundfont Spath
+
+ SfullPath the full path as specified
+
+ Sfile the last part of the path, after Soundfont/ , ie no initial slash
+*/
+opcode dir_soundfont, S, S
+ Spath xin
+ xout strcat(strcat(_dir_audio(), gSpath_soundfont), Spath)
+endop
+
+
+/*
+ Get a full path of subdirectories in the samples directory
+ SfullPath dir_samples Spath
+
+ SfullPath the full path as specified
+
+ Spath the last part of the path, after Samples/ , ie no initial slash
+*/
+opcode dir_samples, S, S
+ Spath xin
+ xout strcat(strcat(_dir_audio(), gSpath_samples), Spath)
+endop
+
+
+/*
+ Get a full path of subdirectories in the random directory
+ SfullPath dir_random Spath
+
+ SfullPath the full path as specified
+
+ Spath the last part of the path, after Random/ , ie no initial slash
+*/
+opcode dir_random, S, S
+ Spath xin
+ xout strcat(strcat(_dir_audio(), gSpath_random), Spath)
+endop
+
+
+
+#end