BSF
From STX Wiki
Jump to navigationJump to search
- File: BSF.STX, linked to library STX.LIB
- Title: soundfile handling
This library uses the following global variables and items
name | type | description | @ParSoundFileNew | global variable | default values for function NewDialog | @ListAudioSampleCode | global variable | list of defined sample code keywords | @MaxAudioChannels | global variable | maximum number of soundfile channels | @MaxAudioSRate | global variable | maximum sampling rate in Hz | @ListAudioSRate | global variable | list of standard sampling rate values | @TempDir | global variable | directory for temporary files | BSFOpenList | table item | list of soundfiles opened with BSF OPEN only used for BScript applications |
SoundFileList | shell variable | name of the shared soundfile table item see BSTXIni |
---|
NewDialog
BSF NEWDIALOG [ srate [ ; nch ; code ]
- New soundfile dialog.
argument | description | default |
---|---|---|
type | Selects the action to perform:
|
OPEN
|
title | The caption of the dialog window. | Select File
|
file | The default file or directory. | current directory |
ftype1 ... | Each ftype argument defines one entry of the filetype-combobox of the dialog. Each filetype is defined by the string | |
RESULT | description | |
path | The full pathname of the file to be opened or created. | |
empty string | If the dialog was canceled. |
- See also
FileCommands
BUTIL COPYFILE src ; dst
- Copy file.
BUTIL MOVEFILE src ; dst
- Copy file.
BUTIL DELETEFILE src
- Copy file.
argument | description | default |
---|---|---|
src | The file to copy, move (rename) or delete. | |
dst | The target file or directory for copy or move (rename) | |
RESULT | description | |
0 |
success | |
rc | The non-zero error code if the command has failed. |
- See also
DirectoryDialog
BUTIL DIRECTORYDIALOG [ title ; path ; restore ; sdmode ; sdvalue ]
DIRECTORYDIALOG [ 'title' [ 'path' 'restore' 'sdmode' 'sdvalue' ]
- Dialog to select a directory.
argument | description | default |
---|---|---|
title | The caption of the dialog window. | Select Directory
|
path | The default directory. | current directory |
restore | no or 0 → do not restore current directory
|
no
|
sdmode | no or 0 → do not display the subdirectories checkbox
|
no
|
sdvalue | Initial state of the subdirectories checkbox: off (=0 ) or on (=1 )
|
off
|
RESULT | description | |
path | If sdmode equals no → The full pathname of the selected directory.
| |
path;sdvalue | If sdmode equals yes → The full pathname of the selected directory and the value of the subdirectories checkbox (0 or 1 ).
| |
empty string | If the dialog was canceled. |
- See also
GetDirectory
BUTIL GETDIRECTORY path
- Check if the directory exists.
argument | description | default |
---|---|---|
path | The directory to be checked. | |
RESULT | description | |
path | The fullpath of the specified directory. | |
$@root |
The STx installation directory if the specified directory was not found. |
- See also
Directory
BUTIL DIRECTORY [ path
]- Select directory and/or get full pathname of working directory.
argument | description | default |
---|---|---|
path | The directory to be selected. | |
RESULT | description | |
path | The fullpath of the selected/current STx working directory. |
- See also
GetSwitch
BUTIL GETSWITCH val ; defval
- Verify and return boolean value.
argument | description | default |
---|---|---|
val | The value to check. Valid values are: 0=no=false=off, 1=yes=true=on
|
|
defval | The default value to be used if val is invalid. The same values as for val can be specified. | 0 |
RESULT | description | |
0 or 1
|
- See also
GetKeyWord
BUTIL GETKEYWORD val ; defval ; keyword1 ...
- Verify keyword and return keyword value.
argument | description | default |
---|---|---|
val | The value to check. | |
defval | The default value to be returned if val is not a keyword. | |
keyword1 ... | Blank seperated list of keywords. | |
RESULT | description | |
keyword | If val is a keyword or an abbreviation of a keyword. | |
defval | otherwise |
- See also
GetKeyIndex
BUTIL GETKEYINDEX val ; defval ; keyword1 ...
- Verify keyword (or index) and return keyword index.
argument | description | default |
---|---|---|
val | The value to check. | |
defval | The default value to be returned if val is not a keyword. | |
keyword1 ... | Blank seperated list of keywords. | |
RESULT | description | |
keyindex | The zero based index of the matching keyword, if val is a keyword or an abbreviation of a keyword. | |
defval | otherwise |
- See also
SelectTable
BUTIL SELECTTABLE table sel
- Select table entries.
argument | description | default |
---|---|---|
table | Name of a table item. | |
sel | The select command:
|
|
RESULT | description | |
nsel | Number of selected table entries. |
- See also