Programmer Guide/Introduction: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
Line 56: Line 56:
!name !!description
!name !!description
|-
|-
|SHELL || The id of the shell and of the parent shell (''thisshell parentshell''). This variable is used by some library macros to communicate with other shells (e.g. [[Programmer_Guide/Macro_Library/POSTMESSAGE|POSTMESSAGE]]
|SHELL || The id of the shell and of the parent shell (''thisshell parentshell''). This variable is used by some library macros to communicate with other shells (e.g. [[Programmer_Guide/Macro_Library/POSTMESSAGE|POSTMESSAGE]])
|-
|-
|BDATASET || The name of the project instance. This variable must be used to access the content of the current project file (see class [[Programmer_Guide/Class_Library/BDataSet|BDATASET]]).
|BDATASET || The name of the project instance. This variable must be used to access the content of the current project file (see class [[Programmer_Guide/Class_Library/BDataSet|BDATASET]]).
Line 62: Line 62:
|BSTXINI || The name of the workspace instance. This variable must be used to access the content of the current workspace file (see class [[Programmer_Guide/Class_Library/BSTXIni_:_BXMLDoc|BSTXINI]]).
|BSTXINI || The name of the workspace instance. This variable must be used to access the content of the current workspace file (see class [[Programmer_Guide/Class_Library/BSTXIni_:_BXMLDoc|BSTXINI]]).
|-
|-
|APPNAME || The name of the application. Only valid if the shell implements a {{STX}} application and was started via the application management system.
|APPNAME || The name of the application. Only valid if the shell implements a {{STX}} application and was started via the application management system.<BR>See also: [[Programmer_Guide/Macro_Library/APPMAIN|APPMAIN]]
|-
|-
|APPTITLE || The title of the application. Only valid if the shell implements a {{STX}} application and was started via the application management system.
|APPTITLE || The title of the application. Only valid if the shell implements a {{STX}} application and was started via the application management system.<BR>See also: [[Programmer_Guide/Macro_Library/APPMAIN|APPMAIN]]
|-
|-
|APPMODE || The run mode of the application. Only valid if the shell implements a {{STX}} application and was started via the application management system.<BR>'''>0''': the application is running, message processing is activated<BR><BR>'''<=0''': the application is finished, message processing is deactivated
|APPMODE || The run mode of the application. Only valid if the shell implements a {{STX}} application and was started via the application management system.<BR>'''>0''': the application is running, message processing is activated<BR><BR>'''<=0''': the application is finished, message processing is deactivated<BR>See also: [[Programmer_Guide/Macro_Library/APPMAIN|APPMAIN]]
|-
|-
|PARENT || The name of the display used as parent window of the application.
|PARENT || The name of the display used as parent window of the application.<BR>See also: [[Programmer_Guide/Macro_Library/CREATEMENU|CREATEMENU]]
|-
|-
|RC || The completion code of the last shell command
|RC || The completion code of the last shell command
Line 74: Line 74:
|EMSG || The text message corresponding to RC
|EMSG || The text message corresponding to RC
|-
|-
|CSF || The full path of the currently selected soundfile. If this variable is empty, no soundfile is selected.
|CSF || The full path of the currently selected soundfile. If this variable is empty, no soundfile is selected.<BR>See also: [[Programmer_Guide/Command_Reference/LOAD|LOAD SOUNDFILE]]
|-
|-
|CSFH || The header parameters of the currently selected soundfile<BR>(''samplingrate channels numberOfSamples samplingCode fileFormat accessMode'')
|CSFH || The header parameters of the currently selected soundfile<BR>(''samplingrate channels numberOfSamples samplingCode fileFormat accessMode'')<BR>See also: [[Programmer_Guide/Command_Reference/LOAD|LOAD SOUNDFILE]]
|}
|}

Revision as of 12:45, 15 April 2011

This chapter contains a general introduction to the structure of the STx programming and execution environment.

Application Environment

The application environment contains all the data structures and functionallities which are available to the whole application.

Loaded Sourcefiles

All scripts, macros, classes and spu's must be loaded from the sourcefile before they can be executed or instantiated. All loaded sources are available to the whole application. Shell commands: LOAD sourcefiles UNLOAD sourcefiles LIST loaded sourcefiles and code objects

Active Shells

All running shells are registered in the application envrionment.

Global Variables

The application environment contains a global variable space, which can be accessed from the whole application. All name prefix character @ is used to address the global variable space. The global variables are used for configuration purposes and should not be changed. The following table shows some of the most important global variables.

name description
@WORK The full pathname of the working directory
@ROOT the full pathname of the STx installation directory
@TEMPDIR The full pathname of the directory for temporary files
@DATASETFILE The full pathname of the active project file
@MASTER The id of the master shell
@OSVER The operating system version
@PROFILE The full pathname of the workspace file

Shell

A shell is the command interpreter and the envrionment executing the loaded code objects. It is created with the SHELL command and ends when the last macro running in the shell is finished (EXIT). All shell are registered in the application environment. A shell can exchange messages with other shells. If a shell is started via the command SHELL mainmacro {arguments}, the macro mainmacro takes control of the shell. If this macro is finished, the shell is also ended

Message Loop

A shell can receive and send messages. The messages are used to communicate with other shells, with the shell items owned by a shell and with the main window of the application. To access the message queue and process messages the command MSG or the library macros GETMESSAGE, DISPATCHMSG, MSGQUEUE, POSTMESSAGE and SETMSGHANDLER can be used.

Shell Items

A shell maintains a list of the owned [Programmer_Guide/Shell_Items|shell items]]. A shell item is owned by a shell if it was created in a macro or instance of a class executed by the shell. Shell items are managed by the commands NEW and DELETE.

  • Normally a shell item is visible only inside a shell, but it is possible to share selected items between shells by using . This technique is used for the workspace and the project
  • All shell items must be deleted before the shell is finished. If the shell executes a user script, using the BScript application, an application cleanup function is used to delete shell items which was created but not deleted by the script.

Shell items are connecting STx with the operation system and its peripherals.

  • The GUI is implemented by the display-, the graph- and the dialog items.
  • The file item can be used to create and access files of several formats, but also to test the existence of a file and to scan directories.
  • tables implements simple database features but can also be used as numerical objects in expressions.
  • The wave item addresses signals stored in soundfiles and/or virtual sequences of synthetic signals. The interface to the sound devices of system for playback and recording is also implemented via the wave items.
  • Via the SPU items a programmable signal processing circuit subsystem is implemented. SPUs can be connected to graphs, value items and to other SPUs.
  • The value item can be used as input for SPUs, as timer and as numerical object in expressions.
  • DCOM and DDECONV items implements interfaces to other applications.
  • ...

Shell Variables

The shell contains a variable space, which can be accessed from all macros and classes executed by the shell. All variables starting with a letter are stored in the shell variable space.

name description
SHELL The id of the shell and of the parent shell (thisshell parentshell). This variable is used by some library macros to communicate with other shells (e.g. POSTMESSAGE)
BDATASET The name of the project instance. This variable must be used to access the content of the current project file (see class BDATASET).
BSTXINI The name of the workspace instance. This variable must be used to access the content of the current workspace file (see class BSTXINI).
APPNAME The name of the application. Only valid if the shell implements a STx application and was started via the application management system.
See also: APPMAIN
APPTITLE The title of the application. Only valid if the shell implements a STx application and was started via the application management system.
See also: APPMAIN
APPMODE The run mode of the application. Only valid if the shell implements a STx application and was started via the application management system.
>0: the application is running, message processing is activated

<=0: the application is finished, message processing is deactivated
See also: APPMAIN
PARENT The name of the display used as parent window of the application.
See also: CREATEMENU
RC The completion code of the last shell command
EMSG The text message corresponding to RC
CSF The full path of the currently selected soundfile. If this variable is empty, no soundfile is selected.
See also: LOAD SOUNDFILE
CSFH The header parameters of the currently selected soundfile
(samplingrate channels numberOfSamples samplingCode fileFormat accessMode)
See also: LOAD SOUNDFILE

Navigation menu

Personal tools