Programmer Guide/Macro Library/BDataSet: Difference between revisions
Line 53: | Line 53: | ||
===GetAttributes=== | ===GetAttributes=== | ||
Get a list of attributes defined in the selected set or segment. | |||
$bdataset GetAttributes <var>type</var> <var>table</var>|list <var>autoExclude</var> <var>excludeList</var> | $bdataset GetAttributes <var>type</var> <var>table</var>|list <var>autoExclude</var> <var>excludeList</var> |
Revision as of 13:46, 17 January 2018
This STx-related article may be outdated.
This class implements the XML Project document. The Project document is the global database available to all STx applications and scripts and contains all data and links of the current project. The programmer must not create or destroy the project object because these functions are performed by the application startup and cleanup macros. So, deleting them manually would cause them to be deleted twice, causing the need for a new instance to be created for no instance to be left.
At application startup a BDATASET
instance is created and linked to the global Project document which is created and managed by the STx master shell and/or the application Project. The name of this instance is stored in the shell variable BDATASET. This object must be used to access the project document.
- Never ever call the member functions
CONSTRUCT
,DESTRUCT
orCLOSE
!
If the project content is changed by a command (or during a block of commands), or if a longer operation is performed on the project, the ATTACH
and DETACH
functions should be called:
$bdataset ATTACH // ...project commands... $bdataset DETACH
No static commands are implemented; a call to the macro BDataSet
(e.g. bdataset save
) will do nothing, returning an empty string.
The class BDataSet
is derived from the class BXMLDoc
.
Beware of using the base class functions, since they do not update the BDataSet
member variables!
Contents
- 1 Public Functions
- 1.1 AddASet
- 1.2 AFileIsLinked
- 1.3 Attach
- 1.4 AttrListView
- 1.5 BackupEmpty
- 1.6 BackupLoad
- 1.7 BackupSave
- 1.8 Construct
- 1.9 CreateWave
- 1.10 CreateWaveEx
- 1.11 DeleteWave
- 1.12 Destruct
- 1.13 Detach
- 1.14 DialogEditSegment
- 1.15 DialogGetAttributes
- 1.16 DialogSelectSegment
- 1.17 EvalSegment
- 1.18 ExportSD0
- 1.19 FindSegment
- 1.20 GetASetInfo
- 1.21 GetAttributes
- 1.22 GetBaseDirectory
- 1.23 GetPath
- 1.24 GetReservedAttributes
- 1.25 GetSegment
- 1.26 GetTemplateForCurrentTag
- 1.27 GetWaveInfo
- 1.28 ImportSD0
- 1.29 ImportXML
- 1.30 IsLinked
- 1.31 IsNewFile
- 1.32 IsRelative
- 1.33 IsReservedAttribute
- 1.34 Load
- 1.35 MakeChannelList
- 1.36 OpenAutoAFile
- 1.37 OpenAutoAFileEx
- 1.38 RemoveTmpSet
- 1.39 RestoreTmpSet
- 1.40 Save
- 1.41 SelectASeg
- 1.42 SelectASet
- 1.43 SetLink
- 1.44 SetRelativity
- 1.45 SetSegment
- 1.46 Validate
Public Functions
AddASet
AFileIsLinked
Attach
Lock the xml-fileitem of the document, this function should be called before the xml-content is changed or a find/query is started. Note: the current position is saved and restored when DETACH is called!
$bdataset attach
- result
- Returns an asterisk if the project file cannot be locked, otherwise returns the project file item.
AttrListView
BackupEmpty
BackupLoad
BackupSave
Construct
DO NOT USE!
CreateWave
CreateWaveEx
DeleteWave
Destruct
DO NOT USE!
Detach
DialogEditSegment
DialogGetAttributes
DialogSelectSegment
EvalSegment
ExportSD0
FindSegment
GetASetInfo
instance GETASETINFO [aset [; type]]
Retrieve information about the currently selected audio set (a soundfile or a sequence). Note that the currently selected audio set (&asetPos) is not necessarily the selected element in the XML file!
- Result
- empty string or 'Soundfile;id;sr;ch;file' or 'Sequence;id;sr;ch
GetAttributes
Get a list of attributes defined in the selected set or segment.
$bdataset GetAttributes type table|list autoExclude excludeList
- table|list
- If a table item is specified, then the attribute list is returned in a table. If 'list' is specified, then a blank separated list of attributes is returned.
This STx-related article may be outdated.
GetBaseDirectory
instance GetBaseDirectory fileitem|filepath
Return the base directory for the specified file item or file path path.
GetPath
GetReservedAttributes
GetSegment
Get attributes of segment.
instance GETSEGMENT aset; aseg; attr1; ...
- aset
- audio set reference (iref | xmlPos | *)
- aseg
- segment reference or name of segment
- attrX
- requested attribute
attrX | valueX |
---|---|
ID or NAME | segmentname |
IREF | iref of segment (reference) |
SEGMENT [unit] | segmentexpression |
POSITION or BEGIN [unit] | begin |
END [unit] | end |
LENGTH [unit] | length |
CHANNEL | channel-number (* for all channels) |
attribute | attributevalue |
- result
- empty string on error or requested attributes (separated by semi-colons if more than 1)
- notes
- If the segment was found, the database position is set to the segment element
- To select the database element of a segment, an empty attribute list can be used
- If an empty attributelist is used, the result is set to '*' to indicate success
GetTemplateForCurrentTag
GetWaveInfo
ImportSD0
ImportXML
IsLinked
IsNewFile
IsRelative
IsReservedAttribute
Load
MakeChannelList
OpenAutoAFile
OpenAutoAFileEx
RemoveTmpSet
RestoreTmpSet
Save
SelectASeg
Select a segment.
$bdataset selectaseg aset; aseg
- aset
- An audio set reference. E.g.
/Samples.wav
- aseg
- The XML position, IREF or ID of a segment
- result
- 0 or errorcode
SelectASet
instance SELECTASET aset [; type]
Select an audio set.
- aset
- audio set reference (or a reference to an element inside the audio set
- type
- audio set type (AFile, Soundfile, ASequence, Sequence or * = default
- Result
- 0 or errorcode
SetLink
SetRelativity
SetSegment
Validate
- File: BDATASET.STX, linked to library STX.LIB
- Title: the project document.
- Parent class: BXMLDoc