Audacity 3.2.0
Classes | Namespaces | Macros | Functions | Variables
NyquistBase.cpp File Reference
#include "NyquistBase.h"
#include "BasicUI.h"
#include "EffectManager.h"
#include "EffectOutputTracks.h"
#include "FileNames.h"
#include "LabelTrack.h"
#include "Languages.h"
#include "NoteTrack.h"
#include "PlatformCompatibility.h"
#include "PluginManager.h"
#include "Prefs.h"
#include "Project.h"
#include "ProjectRate.h"
#include "ShuttleAutomation.h"
#include "SpectrogramSettings.h"
#include "SyncLock.h"
#include "TempDirectory.h"
#include "TimeTrack.h"
#include "TimeWarper.h"
#include "ViewInfo.h"
#include "WaveChannelUtilities.h"
#include "WaveClip.h"
#include "WaveTrack.h"
#include "wxFileNameWrapper.h"
#include "nyquist/xlisp/xlisp.h"
#include "nyx.h"
#include <cfloat>
#include <cstring>
#include <iostream>
#include <wx/log.h>
#include <wx/numformatter.h>
#include <wx/sstream.h>
#include <wx/tokenzr.h>
#include <wx/txtstrm.h>
#include <wx/wfstream.h>
Include dependency graph for NyquistBase.cpp:

Go to the source code of this file.

Classes

struct  NyquistBase::NyxContext
 

Namespaces

namespace  anonymous_namespace{NyquistBase.cpp}
 

Macros

#define NYQ_MAX_LEN   (std::numeric_limits<int64_t>::max())
 

Functions

static void RegisterFunctions ()
 
wxString anonymous_namespace{NyquistBase.cpp}::GetClipBoundaries (const Track *t)
 
static LVAL gettext ()
 
static LVAL gettextc ()
 
static LVAL ngettext ()
 
static LVAL ngettextc ()
 
void * nyq_make_opaque_string (int size, unsigned char *src)
 
void * nyq_reformat_aud_do_response (const wxString &Str)
 
void * ExecForLisp (char *pIn)
 
LVAL xlc_aud_do (void)
 

Variables

static const wxChar * KEY_Command = wxT("Command")
 
static const wxChar * KEY_Parameters = wxT("Parameters")
 

Macro Definition Documentation

◆ NYQ_MAX_LEN

#define NYQ_MAX_LEN   (std::numeric_limits<int64_t>::max())

Definition at line 51 of file NyquistBase.cpp.

Function Documentation

◆ ExecForLisp()

void * ExecForLisp ( char *  pIn)

Definition at line 2939 of file NyquistBase.cpp.

2940{
2941 wxString Str1(pIn);
2942 wxString Str2;
2943
2945
2947}
void * nyq_reformat_aud_do_response(const wxString &Str)
wxString Str2
static result_type Call(Arguments &&...arguments)
Null check of the installed function is done for you.

References GlobalHook< ExecFromMainHook, void(wxString *pIn, wxString *pOut)>::Call(), nyq_reformat_aud_do_response(), and Str2.

Referenced by xlc_aud_do().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gettext()

static LVAL gettext ( )
static

Definition at line 2856 of file NyquistBase.cpp.

2857{
2858 auto string = UTF8CTOWX(getstring(xlgastring()));
2859#if !HAS_I18N_CONTEXTS
2860 // allow ignored context argument
2861 if (moreargs())
2862 nextarg();
2863#endif
2864 xllastarg();
2865 return cvstring(GetCustomTranslation(string).mb_str(wxConvUTF8));
2866}
STRINGS_API const wxString & GetCustomTranslation(const wxString &str1)
Definition: Internat.cpp:46
#define UTF8CTOWX(X)
Definition: Internat.h:157

References GetCustomTranslation(), and UTF8CTOWX.

Referenced by gettextc(), and RegisterFunctions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gettextc()

static LVAL gettextc ( )
static

Definition at line 2868 of file NyquistBase.cpp.

2869{
2870#if HAS_I18N_CONTEXTS
2871 auto string = UTF8CTOWX(getstring(xlgastring()));
2872 auto context = UTF8CTOWX(getstring(xlgastring()));
2873 xllastarg();
2874 return cvstring(
2875 wxGetTranslation(string, "", 0, "", context).mb_str(wxConvUTF8));
2876#else
2877 return gettext();
2878#endif
2879}
static LVAL gettext()

References gettext(), and UTF8CTOWX.

Referenced by RegisterFunctions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ngettext()

static LVAL ngettext ( )
static

Definition at line 2881 of file NyquistBase.cpp.

2882{
2883 auto string1 = UTF8CTOWX(getstring(xlgastring()));
2884 auto string2 = UTF8CTOWX(getstring(xlgastring()));
2885 auto number = getfixnum(xlgafixnum());
2886#if !HAS_I18N_CONTEXTS
2887 // allow ignored context argument
2888 if (moreargs())
2889 nextarg();
2890#endif
2891 xllastarg();
2892 return cvstring(
2893 wxGetTranslation(string1, string2, number).mb_str(wxConvUTF8));
2894}

References UTF8CTOWX.

Referenced by ngettextc(), and RegisterFunctions().

Here is the caller graph for this function:

◆ ngettextc()

static LVAL ngettextc ( )
static

Definition at line 2896 of file NyquistBase.cpp.

2897{
2898#if HAS_I18N_CONTEXTS
2899 auto string1 = UTF8CTOWX(getstring(xlgastring()));
2900 auto string2 = UTF8CTOWX(getstring(xlgastring()));
2901 auto number = getfixnum(xlgafixnum());
2902 auto context = UTF8CTOWX(getstring(xlgastring()));
2903 xllastarg();
2904 return cvstring(wxGetTranslation(string1, string2, number, "", context)
2905 .mb_str(wxConvUTF8));
2906#else
2907 return ngettext();
2908#endif
2909}
static LVAL ngettext()

References ngettext(), and UTF8CTOWX.

Referenced by RegisterFunctions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nyq_make_opaque_string()

void * nyq_make_opaque_string ( int  size,
unsigned char *  src 
)

Definition at line 2911 of file NyquistBase.cpp.

2912{
2913 LVAL dst;
2914 unsigned char* dstp;
2915 dst = new_string((int)(size + 2));
2916 dstp = getstring(dst);
2917
2918 /* copy the source to the destination */
2919 while (size-- > 0)
2920 *dstp++ = *src++;
2921 *dstp = '\0';
2922
2923 return (void*)dst;
2924}

References size.

◆ nyq_reformat_aud_do_response()

void * nyq_reformat_aud_do_response ( const wxString &  Str)

Definition at line 2926 of file NyquistBase.cpp.

2927{
2928 LVAL dst;
2929 LVAL message;
2930 LVAL success;
2931 wxString Left = Str.BeforeLast('\n').BeforeLast('\n').ToAscii();
2932 wxString Right = Str.BeforeLast('\n').AfterLast('\n').ToAscii();
2933 message = cvstring(Left);
2934 success = Right.EndsWith("OK") ? s_true : nullptr;
2935 dst = cons(message, success);
2936 return (void*)dst;
2937}

Referenced by ExecForLisp().

Here is the caller graph for this function:

◆ RegisterFunctions()

static void RegisterFunctions ( )
static

Definition at line 2972 of file NyquistBase.cpp.

2973{
2974 // Add functions to XLisp. Do this only once,
2975 // before the first call to nyx_init.
2976 static bool firstTime = true;
2977 if (firstTime)
2978 {
2979 firstTime = false;
2980
2981 // All function names must be UP-CASED
2982 static const FUNDEF functions[] = {
2983 { "_", SUBR, gettext }, { "_C", SUBR, gettextc },
2984 { "NGETTEXT", SUBR, ngettext }, { "NGETTEXTC", SUBR, ngettextc },
2985 { "AUD-DO", SUBR, xlc_aud_do },
2986 };
2987
2988 xlbindfunctions(functions, WXSIZEOF(functions));
2989 }
2990}
static LVAL gettextc()
LVAL xlc_aud_do(void)
static LVAL ngettextc()

References gettext(), gettextc(), ngettext(), ngettextc(), and xlc_aud_do().

Referenced by NyquistBase::Process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xlc_aud_do()

LVAL xlc_aud_do ( void  )

Definition at line 2951 of file NyquistBase.cpp.

2952{
2953 // Based on string-trim...
2954 unsigned char* leftp;
2955 LVAL src, dst;
2956
2957 /* get the string */
2958 src = xlgastring();
2959 xllastarg();
2960
2961 /* setup the string pointer */
2962 leftp = getstring(src);
2963
2964 // Go call my real function here...
2965 dst = (LVAL)ExecForLisp((char*)leftp);
2966
2967 // dst = cons(dst, (LVAL)1);
2968 /* return the new string */
2969 return (dst);
2970}
void * ExecForLisp(char *pIn)

References ExecForLisp().

Referenced by RegisterFunctions().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ KEY_Command

const wxChar* KEY_Command = wxT("Command")
static

◆ KEY_Parameters

const wxChar* KEY_Parameters = wxT("Parameters")
static