diff --git a/src/commands/ScriptCommandRelay.cpp b/src/commands/ScriptCommandRelay.cpp index dd10a6137..29f510891 100644 --- a/src/commands/ScriptCommandRelay.cpp +++ b/src/commands/ScriptCommandRelay.cpp @@ -141,6 +141,8 @@ int ExecCommand2(wxString *pIn, wxString *pOut) // The void * return is actually a Lisp LVAL and will be cast to such as needed. extern void * ExecForLisp( char * pIn ); extern void * nyq_make_opaque_string( int size, unsigned char *src ); +extern void * nyq_reformat_aud_do_response(const wxString & Str); + void * ExecForLisp( char * pIn ){ wxString Str1( pIn ); @@ -148,11 +150,11 @@ void * ExecForLisp( char * pIn ){ ExecCommand2( &Str1, &Str2 ); // wxString provides a const char * - const char * pStr = static_cast(Str2); + //const char * pStr = static_cast(Str2); // We'll be passing it as a non-const unsigned char * // That 'unsafe' cast is actually safe. nyq_make_opaque_string is just copying the string. - void * pResult = nyq_make_opaque_string( Str2.Length(), (unsigned char *)pStr ); + void * pResult = nyq_reformat_aud_do_response( Str2 ); return pResult; }; diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 64534a957..6d7f97556 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -3201,7 +3201,7 @@ static LVAL ngettext() /* These functions may later move to their own source file. */ extern void * ExecForLisp( char * pIn ); extern void * nyq_make_opaque_string( int size, unsigned char *src ); - +extern void * nyq_reformat_aud_do_response(const wxString & Str); void * nyq_make_opaque_string( int size, unsigned char *src ){ LVAL dst; @@ -3217,6 +3217,19 @@ void * nyq_make_opaque_string( int size, unsigned char *src ){ return (void*)dst; } +void * nyq_reformat_aud_do_response(const wxString & Str) { + LVAL dst; + LVAL message; + LVAL success; + wxString Left = Str.BeforeLast('\n').BeforeLast('\n'); + wxString Right = Str.BeforeLast('\n').AfterLast('\n'); + message = cvstring(Left); + success = Right.EndsWith("OK") ? cvfixnum(1) : NIL; + dst = cons(message, success); + return (void *)dst; +} + + /* xlc_aud_do -- interface to C routine aud_do */ /**/ LVAL xlc_aud_do(void) @@ -3236,6 +3249,7 @@ LVAL xlc_aud_do(void) // Go call my real function here... dst = (LVAL)ExecForLisp( (char *)leftp ); + //dst = cons(dst, (LVAL)1); /* return the new string */ return (dst); }