Programmer Guide/Macro Library/BSF: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 66: Line 66:
|}
|}
;See also:
;See also:
==FileCommands==
==OpenDialog==
;<code>BUTIL COPYFILE <var>src</var> ; <var>dst</var></code>: Copy file.
 
;<code>BUTIL MOVEFILE <var>src</var> ; <var>dst</var></code>: Copy file.
==Open==
;<code>BUTIL DELETEFILE <var>src</var></code>: Copy file.
 
{|class="einrahmen"
==Close==
!argument !!description !!default
 
|-
==CloseAll==
|<var>src</var>
 
|The file to copy, move (rename) or delete.
==Select==
|
 
|-
==Truncate==
|<var>dst</var>
|The target file or directory for copy or move (rename)
|
|-
!RESULT !!description
|-
|<code>0</code> ||success
|-
|<var>rc</var> ||The non-zero error code if the command has failed.
|}
;See also:
==DirectoryDialog==
;<code>BUTIL DIRECTORYDIALOG [ <var>title</var> ; <var>path</var> ; <var>restore</var> ; <var>sdmode</var> ; <var>sdvalue</var> ]</code>:
;<code>DIRECTORYDIALOG [ '<var>title</var>' [ '<var>path</var>' '<var>restore</var>' '<var>sdmode</var>' '<var>sdvalue</var>' ]</code>: Dialog to select a directory.
{|class="einrahmen"
!argument !!description !!default
|-
|<var>title</var>
|The caption of the dialog window.
|<code>Select Directory</code>
|-
|<var>path</var>
|The default directory.
|current directory
|-
|<var>restore</var>
|<code>no</code> or <code>0</code> &rarr; do not restore current directory<BR>
<code>yes</code> or <code>1</code> &rarr; restore current directory
|<code>no</code>
|-
|<var>sdmode</var>
|<code>no</code> or <code>0</code> &rarr; do not display the '''subdirectories''' checkbox<BR>
<code>yes</code> or <code>1</code> &rarr; display the '''subdirectories''' checkbox
|<code>no</code>
|-
|<var>sdvalue</var>
|Initial state of the '''subdirectories''' checkbox: <code>off</code> (=<code>0</code>) or <code>on</code> (=<code>1</code>)
|<code>off</code>
|-
!RESULT !!description
|-
|<var>path</var> ||If <var>sdmode</var> equals <code>no</code> &rarr; The full pathname of the selected directory.
|-
|<var>path;sdvalue</var> ||If <var>sdmode</var> equals <code>yes</code> &rarr; The full pathname of the selected directory and the value of the '''subdirectories''' checkbox (<code>0</code> or <code>1</code>).
|-
|''empty string'' ||If the dialog was canceled.
|}
;See also:
==GetDirectory==
;<code>BUTIL GETDIRECTORY <var>path</var></code>: Check if the directory exists.
{|class="einrahmen"
!argument !!description !!default
|-
|<var>path</var>
|The directory to be checked.
|
|-
!RESULT !!description
|-
|<var>path</var> ||The fullpath of the specified directory.
|-
|<code>$@root</code> ||The {{STX}} installation directory if the specified directory was not found.
|}
;See also:
==Directory==
;<code>BUTIL DIRECTORY [ <var>path</var></code> ]: Select directory and/or get full pathname of working directory.
{|class="einrahmen"
!argument !!description !!default
|-
|<var>path</var>
|The directory to be selected.
|
|-
!RESULT !!description
|-
|<var>path</var> ||The fullpath of the selected/current {{STX}} working directory.
|}
;See also:
==GetSwitch==
;<code>BUTIL GETSWITCH <var>val</var> ; <var>defval</var></code>: Verify and return boolean value.
{|class="einrahmen"
!argument !!description !!default
|-
|<var>val</var>
|The value to check.<BR>Valid values are: <code>0=no=false=off, 1=yes=true=on</code>
|
|-
|<var>defval</var>
|The default value to be used if <var>val</var> is invalid. The same values as for <var>val</var> can be specified.
|0
|-
!RESULT !!description
|-
|<code>0</code> or <code>1</code>
|
|}
;See also:
==GetKeyWord==
;<code>BUTIL GETKEYWORD <var>val</var> ; <var>defval</var> ; <var>keyword1</var> ...</code>: Verify keyword and return keyword value.
{|class="einrahmen"
!argument !!description !!default
|-
|<var>val</var>
|The value to check.
|
|-
|<var>defval</var>
|The default value to be returned if <var>val</var> is not a keyword.
|
|-
|<var>keyword1</var> ...
|Blank seperated list of keywords.
|
|-
!RESULT !!description
|-
|<var>keyword</var> ||If <var>val</var> is a keyword or an abbreviation of a keyword.
|-
|<var>defval</var> ||otherwise
|}
;See also:
==GetKeyIndex==
;<code>BUTIL GETKEYINDEX <var>val</var> ; <var>defval</var> ; <var>keyword1</var> ...</code>: Verify keyword (or index) and return keyword index.
{|class="einrahmen"
!argument !!description !!default
|-
|<var>val</var>
|The value to check.
|
|-
|<var>defval</var>
|The default value to be returned if <var>val</var> is not a keyword.
|
|-
|<var>keyword1</var> ...
|Blank seperated list of keywords.
|
|-
!RESULT !!description
|-
|<var>keyindex</var> ||The zero based index of the matching keyword, if <var>val</var> is a keyword or an abbreviation of a keyword.
|-
|<var>defval</var> ||otherwise
|}
;See also:
==SelectTable==
;<code>BUTIL SELECTTABLE <var>table</var> <var>sel</var></code>: Select table entries.
{|class="einrahmen"
!argument !!description !!default
|-
|<var>table</var>
|Name of a table item.
|
|-
|<var>sel</var>
|The select command:<BR>
<code>ALL</code> &rarr; select all entries<BR>
<code>TOGGLE</code> &rarr; toggle (invert) selection<BR>
<code>NONE</code> &rarr; clear selection, deseclect all entries
|
|-
!RESULT !!description
|-
|<var>nsel</var> ||Number of selected table entries.
|}
;See also:

Revision as of 17:28, 11 May 2011

  • File: BSF.STX, linked to library STX.LIB
  • Title: soundfile handling

Content
NewDialog OpenDialog
Open Close CloseAll Select Truncate
Variables and items used by this library
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:

LOAD or OPEN → open existing file
SAVE or NEW → create new file

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 extension=description.
Example: WAV=wave files
If a ftype argument is the name of a (simple) table item, each entry of the table defines a filetype.

RESULT description
path The full pathname of the file to be opened or created.
empty string If the dialog was canceled.
See also

OpenDialog

Open

Close

CloseAll

Select

Truncate

Navigation menu

Personal tools