User Guide/Project/Dialog Template: Difference between revisions
m (1 revision: Initial import) |
|||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
{{UG_Project}} | |||
[[Category:Templates]] | |||
{{STX}} projects support user-defined attributes for describing sound files and segments. Accessing these user-defined attributes via the GUI is achieved by displaying a list of existing attributes (e.g. here in the [[User Guide/Project/Editing segments|Edit Segment dialog]]). | |||
[[File:ws_dialog_aseg_properties_list.png]] | [[File:ws_dialog_aseg_properties_list.png]] | ||
Line 14: | Line 14: | ||
Dialog templates are defined using XML and must be stored in the templates directory. | Dialog templates are defined using XML and must be stored in the templates directory. | ||
==Defining a dialog template== | |||
The | The {{STX}} dialog template is an XML file. The root element must be one of the following tags: | ||
*<code>DialogTemplate</code> | *<code>DialogTemplate</code> | ||
Line 38: | Line 38: | ||
</ASegTemplate> | </ASegTemplate> | ||
</pre> | </pre> | ||
For a detailed description of template parameters, please see the template file | For a detailed description of template parameters, please see the template file <code>DefaultASegTemplate.xml</code> in the templates directory. | ||
Note that the Segment Template Management dialog is useful for developing templates. | Note that the Segment Template Management dialog is useful for developing templates. | ||
==Assigning templates== | |||
There are a number of places where dialog templates can be used. | There are a number of places where dialog templates can be used. | ||
Line 50: | Line 50: | ||
A segment template can be assigned to a sound file via the Templates context menu in the Overview. The assigned template is then used in the Waveform & Segmentation Viewer and Spectrogram & Parameters Viewer segment dialogs. | A segment template can be assigned to a sound file via the Templates context menu in the Overview. The assigned template is then used in the Waveform & Segmentation Viewer and Spectrogram & Parameters Viewer segment dialogs. | ||
==Segment Template Management Dialog== | |||
[[File:ws_dialog_asegtemplate_management_dialog.png]] | [[File:ws_dialog_asegtemplate_management_dialog.png]] |
Latest revision as of 08:26, 6 April 2018
STx projects support user-defined attributes for describing sound files and segments. Accessing these user-defined attributes via the GUI is achieved by displaying a list of existing attributes (e.g. here in the Edit Segment dialog).
Using a dialog template, however, this list can be displayed using a number of different dialog controls.
This can be very useful, if you are entering a lot of data.
Dialog templates are defined using XML and must be stored in the templates directory.
Defining a dialog template
The STx dialog template is an XML file. The root element must be one of the following tags:
DialogTemplate
ASegTemplate
attrTemplate
Below is an example of an audio segment template.
<?xml version="1.0" encoding="UTF-8"?> <ASegTemplate> <Control Type="Static" Text="Type" Window="0 0 4 1" Flags="/R"/> <Control Type="ComboBox" Name="Type" Window="0 4 9 1" Flags="/E/U" Default="uncl" Values="uttr phon word syll uncl"/> <Control Type="Static" Text="Speaker" Window="1 0 7 1" Flags="/R"/> <Control Type="ComboBox" Name="Spk" Window="1 7 6 1" Flags="/E/U" Default="uncl" Values="m1 m2 m3 f1 f2 f3 uncl"/> <Control Type="Static" Text="TR1" Window="2 13 3 1" Flags="/R"/> <Control Type="Edit" Name="TR1" Window="2 16 37 3" Flags="/M/W=**ff" Font="Userfont"/> <Control Type="Static" Text="TR2" Window="1 13 3 1" Flags="/R"/> <Control Type="Edit" Name="TR2" Window="1 16 37 1" Flags="/W=**f*" Font="Userfont"/> <Control Type="Static" Text="TR3" Window="0 13 3 1" Flags="/R"/> <Control Type="Edit" Name="TR3" Window="0 16 37 1" Flags="/W=**f*" Font="Userfont"/> </ASegTemplate>
For a detailed description of template parameters, please see the template file DefaultASegTemplate.xml
in the templates directory.
Note that the Segment Template Management dialog is useful for developing templates.
Assigning templates
There are a number of places where dialog templates can be used.
- Edit Segment dialog
- Waveform & Segmentation Viewer and Spectrogram & Parameters Viewer
A segment template can be assigned to a sound file via the Templates context menu in the Overview. The assigned template is then used in the Waveform & Segmentation Viewer and Spectrogram & Parameters Viewer segment dialogs.
Segment Template Management Dialog
Segment templates are special templates used to display segment attributes (xml root ASegTemplate
). A list of available templates (those found in the templates directory) can be displayed using the ASegTemplate Management Dialog, reachable via the Overview context menu Template->Manage whilst a sound file is selected.
This dialog is particularly useful, when developing templates, since clicking the Show button will display a dialog based on the template.