From 9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 13 Apr 2025 18:48:02 +0100 Subject: initial --- site/udo/host_tools.udo | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100755 site/udo/host_tools.udo (limited to 'site/udo/host_tools.udo') 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 -- cgit v1.2.3