mirror of
https://codeberg.org/tenacityteam/tenacity
synced 2025-09-25 07:59:03 +02:00
mod-script-pipe: Rename pipe name
Scripts that communicate with Tenacity now need to be updated to use the new pipe name, 'tenacity_script_pipe.{to,from}.{pid}'. This should also prevent conflicts if Audacity's pipe server is running at the same time with Tenacity's pipe server. Signed-off-by: Avery King <avery98@pm.me>
This commit is contained in:
@@ -114,7 +114,7 @@ void PipeServer()
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
const char fifotmpl[] = "/tmp/audacity_script_pipe.%s.%d";
|
||||
const char fifotmpl[] = "/tmp/tenacity_script_pipe.%s.%d";
|
||||
|
||||
const int nBuff = 1024;
|
||||
|
||||
|
@@ -19,8 +19,8 @@ def startPipes() :
|
||||
EOL = '\r\n\0'
|
||||
else:
|
||||
print( "pipe-test.py, running on linux or mac" )
|
||||
toname = '/tmp/audacity_script_pipe.to.' + str(os.getuid())
|
||||
fromname = '/tmp/audacity_script_pipe.from.' + str(os.getuid())
|
||||
toname = '/tmp/tenacity_script_pipe.to.' + str(os.getuid())
|
||||
fromname = '/tmp/tenacity_script_pipe.from.' + str(os.getuid())
|
||||
EOL = '\n'
|
||||
|
||||
print( "Write to \"" + toname +"\"" )
|
||||
|
@@ -17,8 +17,8 @@ if( sys.platform == 'win32' ):
|
||||
EOL = '\r\n\0'
|
||||
else:
|
||||
print( "get-gui-structure.py, running on linux or mac" )
|
||||
toname = '/tmp/audacity_script_pipe.to.' + str(os.getuid())
|
||||
fromname = '/tmp/audacity_script_pipe.from.' + str(os.getuid())
|
||||
toname = '/tmp/tenacity_script_pipe.to.' + str(os.getuid())
|
||||
fromname = '/tmp/tenacity_script_pipe.from.' + str(os.getuid())
|
||||
EOL = '\n'
|
||||
|
||||
print( "Write to \"" + toname +"\"" )
|
||||
|
@@ -33,12 +33,12 @@ if ($^O eq 'MSWin32') {
|
||||
$FromSrvName = '\\\\.\\pipe\\From'.$Name.'Pipe';
|
||||
} elsif ($^O eq 'linux') {
|
||||
$UID = $<;
|
||||
$ToSrvName = '/tmp/audacity_script_pipe.to.'.$UID;
|
||||
$FromSrvName = '/tmp/audacity_script_pipe.from.'.$UID;
|
||||
$ToSrvName = '/tmp/tenacity_script_pipe.to.'.$UID;
|
||||
$FromSrvName = '/tmp/tenacity_script_pipe.from.'.$UID;
|
||||
} elsif ($^O eq 'darwin') {
|
||||
$UID = $<;
|
||||
$ToSrvName = '/tmp/audacity_script_pipe.to.'.$UID;
|
||||
$FromSrvName = '/tmp/audacity_script_pipe.from.'.$UID;
|
||||
$ToSrvName = '/tmp/tenacity_script_pipe.to.'.$UID;
|
||||
$FromSrvName = '/tmp/tenacity_script_pipe.from.'.$UID;
|
||||
}
|
||||
|
||||
# Open pipes
|
||||
@@ -74,7 +74,9 @@ sub stopTiming{
|
||||
sub sendCommand{
|
||||
my $command = shift;
|
||||
if ($^O eq 'MSWin32') {
|
||||
print TO_SRV "$command
|
||||
print TO_SRV "$command
|
||||
|
||||
\r\n\0";
|
||||
} else {
|
||||
# Don't explicitly send \0 on Linux or reads after the first one fail...
|
||||
print TO_SRV "$command\n";
|
||||
|
@@ -25,8 +25,8 @@ if sys.platform == 'win32':
|
||||
EOL = '\r\n\0'
|
||||
else:
|
||||
print("pipe-test.py, running on linux or mac")
|
||||
TONAME = '/tmp/audacity_script_pipe.to.' + str(os.getuid())
|
||||
FROMNAME = '/tmp/audacity_script_pipe.from.' + str(os.getuid())
|
||||
TONAME = '/tmp/tenacity_script_pipe.to.' + str(os.getuid())
|
||||
FROMNAME = '/tmp/tenacity_script_pipe.from.' + str(os.getuid())
|
||||
EOL = '\n'
|
||||
|
||||
print("Write to \"" + TONAME +"\"")
|
||||
|
@@ -87,7 +87,7 @@ if sys.platform == 'win32':
|
||||
EOL = '\r\n\0'
|
||||
else:
|
||||
# Linux or Mac
|
||||
PIPE_BASE = '/tmp/audacity_script_pipe.'
|
||||
PIPE_BASE = '/tmp/tenacity_script_pipe.'
|
||||
WRITE_NAME = PIPE_BASE + 'to.' + str(os.getuid())
|
||||
READ_NAME = PIPE_BASE + 'from.' + str(os.getuid())
|
||||
EOL = '\n'
|
||||
|
@@ -62,8 +62,8 @@ if sys.platform == 'win32':
|
||||
EOL = '\r\n\0'
|
||||
else:
|
||||
print("recording-test.py, running on linux or mac")
|
||||
PIPE_TO_AUDACITY = '/tmp/audacity_script_pipe.to.' + str(os.getuid())
|
||||
PIPE_FROM_AUDACITY = '/tmp/audacity_script_pipe.from.' + str(os.getuid())
|
||||
PIPE_TO_AUDACITY = '/tmp/tenacity_script_pipe.to.' + str(os.getuid())
|
||||
PIPE_FROM_AUDACITY = '/tmp/tenacity_script_pipe.from.' + str(os.getuid())
|
||||
EOL = '\n'
|
||||
|
||||
|
||||
|
@@ -32,8 +32,8 @@ end
|
||||
global TMP_FILENAME;
|
||||
global EXPORT_TEST_SIGNALS;
|
||||
UID=num2str(getuid());
|
||||
PIPE_TO_PATH=strcat("/tmp/audacity_script_pipe.to.", UID);
|
||||
PIPE_FROM_PATH=strcat("/tmp/audacity_script_pipe.from.", UID);
|
||||
PIPE_TO_PATH=strcat("/tmp/tenacity_script_pipe.to.", UID);
|
||||
PIPE_FROM_PATH=strcat("/tmp/tenacity_script_pipe.from.", UID);
|
||||
TMP_FILENAME=strcat(pwd(), "/tmp.wav");
|
||||
EXPORT_TEST_SIGNALS = false;
|
||||
|
||||
|
Reference in New Issue
Block a user