xig.me

来自「speech signal process tools」· ME 代码 · 共 497 行 · 第 1/2 页

ME
497
字号
input signal files, label files, and label menu files.  IfWAVES_INPUT_PATH is not defined, the default path used is".:$ESPS_BASE/lib/waves/files"..ip WAVES_LIB_PATHThis is the path used by \fIwaves+\fP and \fIxwaves+\fP to find certain libraryfiles.  If WAVES_LIB_PATH is not defined, the default path used is"$ESPS_BASE/lib/waves"..ip WAVES_MENU_PATHThis is the path used by \fIxwaves+\fP to find olwm-format menu files usedwith the \fIxwaves+\fP command \fImake_panel\fP.  If WAVES_MENU_PATH is notdefined, the default path used is ".:$ESPS_BASE/lib/waves/menus"..ip WAVES_COMMAND_PATHThis is the path used by \fIwaves\fP+ and \fIxwaves+\fP to findcommand files.  If WAVES_COMMAND_PATH is not defined, the default pathused is ".:$ESPS_BASE/lib/waves/commands"..ip WAVES_COLORMAP_PATHThis is the path used by \fIwaves+\fP and \fIxwaves+\fP to find colormaps.  IfWAVES_COLORMAP_PATH is not defined, the default path used is".:$ESPS_BASE/lib/waves/colormaps"..ip  WAVES_PROFILE_PATHThis is the path used by \fIwaves+\fP and \fIxwaves+\fP to find the startupprofile.  IF WAVES_PROFILE_PATH is not defined, the default path usedis "$HOME:$ESPS_BASE/lib/waves"..ip WAVES_HOSTThis is the hostname of an \fIxwaves+\fP display server.  That is,\fIsend_xwaves\fP (1\-\s-1ESPS\s+1) \fIsend_xwaves\fP(3\-\s-1ESPS\s+1) attempt to send messages to an \fIxwaves+\fP processrunning on WAVES_HOST.  If WAVES_HOST is not defined, the local hostis assumed..ip WAVES_PORTThis is the INET domain socket port number used by \fIsend_xwaves\fP(1\-\s-1ESPS\s+1) and \fIsend_xwaves\fP (3\-\s-1ESPS\s+1) when sendingmessages to an \fIxwaves+\fP display server.  It is also used by\fIxwaves+\fP in determining the port on which to listen.  IfWAVES_PORT is not defined, than a compiled-in default is used.  Thisis the default socket that \fIxwaves+\fP listens on when started inserver mode (\fB-s\fP).  If a non-default socket is to be used, it isspecified to \fIxwaves+\fP, \fIsend_xwaves\fP (1\-\s-1ESPS\s+1), and\fIsend_xwaves\fP (3\-\s-1ESPS\s+1) by means of WAVES_PORT.  Note that\fIsend_xwaves\fP (1\-\s-1ESPS\s+1) and \fIxwaves+\fP also have a \fB-p\fP option that canbe used to override WAVES_PORT..ip  BBOX_QUIT_BUTTONIf this variable is defined, it forces a "QUIT" button to be includedat the top of every button panel created via \fIexv_bbox\fP(3\-\s-1ESPS\s+1).  This includes button panels created by\fImbuttons\fP (1\-\s-1ESPS\s+1), \fIfbuttons\fP (1\-\s-1ESPS\s+1),and the \fIxwaves+\fP command \fImake_panel\fP.  The variable has noeffect if a quit button was specified directly using the \fB-q\fPoption to \fImbuttons\fP or the \fIquit_button\fP keyword of the\fIxwaves+\fP command \fImake_panel\fP..ip DEF_HEADERIf defined when ESPS programs or \fIxwaves\fP+ encountersa headerless file, DEF_HEADER specifies a default header to be used.  Note that the value of \fIDEF_HEADER\fP relevant for \fIxwaves\fP+ isthe value in the environment when \fIxwaves\fP+ starts up.  .sh 1 "COMBINING AND ENCAPSULATING THE XIG FEATURES".lpThe demos that are accessible from the panel put up by \fIedemos\fP(1\-\s-1ESPS\s+1) all serve as examples for how to make use of thefacilities mentioned above.  They operate in a manner that encapsulates anapplication and presents it to the user with an application-specificuser-interface.  .lpAs an example for discussion here, we shall make use of the demo that facilitates the creation and spectrum analysis of test signals.  This demo is located in $ESPS_BASE/newdemos/testsignal.  .sh 2 "Directory Organization" .lpThe \fItestsignal\fP directory is organized as follows:.nf   % ls $ESPS_BASE/newdemos/testsignal   README  bin/    files/  menus/   params/  rundemo*  wcommands/.fi.SM .25i.ip \fIrundemo\fP 15Users start up the application by invoking this script.  .ip \fIREADME\fP 15 This is an ASCII file containing a brief overview of the application.  .ip \fIbin\fP 15This is a directory containing executable programs and scriptsneeded by the application.  .ip  \fIfiles\fP 15This is a directory containing input files needed in the application, including the \fIxwaves\fP+ startup profile.  .ip \fImenus\fP 15This is a directory containing (\fIolwm\fP-format) menu files needed in the application.  Such files are used bythe programs \fIfbuttons\fP and \fImbuttons\fP, and also by the \fIxwaves\fP+ command \fImake_panel\fP.  .ip \fIparams\fP 15This is a directory containing ESPS parameter files needed in the application. .ip \fIwcommands\fP 15This is a directory containing \fIxwaves\fP+ command files needed in the application. .RM.sh 2 "How it Works".lpAs mentioned above, users start the application by running the script\fIrundemo\fP.  (In the case of \fItestsignal\fP, this is often doneindirectly via a button on a demo panel.)  To understand how it works,it is helpful to run the demo now.  Click on "\fISee Demo Scripts andFiles\fP", which brings up another panel, and then click on "rundemo(startup script)" in the new panel.  You can then track the followingdescription of \fIrundemo\fP's actions (when appropriate, click onadditional buttons to see other files):.npCreates or checks a directory that will be used for output files, andexports an environment variable with the full path to that directory.\fITestsignal\fP is an example of a multi-user application that uses aset of standard, read-only, input files for everyone, but that alsoneeds to write output files that are user-specific.  To handle this\fIrundemo\fP takes a single argument: the path of a writabledirectory that can be used for output files.  If the argument ismissing, \fIrundemo\fP sets it to a unique subdirectory of /usr/tmp..npSets and exports environment variables for various ESPS and\fIxwaves\fP+ paths.  Most of these cause the application to get menus, parameter file, command files, and executables from the subdirectories below \fIrundemo\fP.  .npCreates a unique \fIxwaves\fP+ server port number and exports it via WAVES_PORT.  .npRuns \fIbin/guess_audio\fP to try and set up output D/A according to whatis available..npModifies a standard \fIxwaves\fP+ profile (\fIfiles/waves_pro\fP) toset \fIoutput_dir\fP to the output directory determined by (1), above.(The resulting profile is written to that directory.).npStarts \fIxwaves\fP+ in server mode, using the \fIxwaves\fP+ profilecreated by (5).  The \fIinit_file\fP global is set so that the commandfile \fIwcommands/demoinit.WC\fP is run when \fIxwaves\fP+ starts up.This command file does the following:.SM .5i.ip \ \ \(bureconfigures the \fIxwaves\fP+ menu;.ip \ \ \(bustarts the attachment \fIxspectrum\fP;.ip \ \ \(bubrings up two \fIxwaves\fP+ control panels, one for mouse bindingsand one for miscellaneous controls. .ip \ \ \(busets \fIxspectrum\fP to display using harmonic cursors and to computeusing the fast modified Burg method; .ip \ \ \(buputs up an initial test signal (\fIfiles/sample.sd\fP).ip \ \ \(bucomputes an initial spectrum;.ip \ \ \(buputs up the text of the README file describing the application.RM.ipNote that \fIxwaves\fP+ is started up in the background, so that the\fIrundemo\fP script proceeds..npPuts up an application control panel using \fImbuttons\fP(1\-\s-1ESPS\s+1) running on the menu file \fItsignal.BM\fP.  (Otherapplications use \fIfbuttons\fP (1\-\s-1ESPS\s+1); see the\fItimitdemo\fP, for example.)  The menu file \fItsignal.BM\fP yields the following buttons: .SM .5i.ip \fIQUIT\fPexits \fImbuttons\fP (and the application).ip \fIREADME\fPputs up the README file (again) .ip "\fISetup Audio Output\fP"this is a button menu with selections for different output options.ip "\fIGenerate New Test Signal\fP"this invokes the script \fIbin/newsignal\fP, which kills the currentsignal displays, uses \fIexprompt\fP (1\-\s-1ESPS\s+1) to prompt theuser for new signal and noise parameters, computes the new signal plusnoise, displays the signal, and computes an initial spectrum;.ip "\fIsee Demo Scripts and Files\fP"this brings up another panel with a button to display each of the files in the application; this is appropriate for a demo, but usually not for a turn-key application;.RM.ipAs an example of the simplicity of the configuration files usedby \fImbuttons\fP, \fIfbuttons\fP, and the \fIxwaves\fP+ command\fImake_panel\fP, here is the text of the file that creates the buttons described above (\fImenu/tsignal.BM\fP):.nf.ta 3.2i  README	xtext -Wp 555 400 -F README	  "Setup Audio Output" MENU    "Setup SPARCStation Output"	rm -f bin/play; \\	ln -s `get_esps_base`/bin/splay bin/play    "Setup Ariel S32C Output"	rm -f bin/play; \\	ln -s `get_esps_base`/bin/s32cplay bin/play    "Setup AT&T FAB2 Output"	rm -f bin/play; \\	ln -s `get_esps_base`/bin/wplay bin/play    "Setup no output"	rm -f bin/play; \\	ln -s `pwd`/bin/null_play bin/play  "Setup Audio Output" END  "Generate New Test Signal"	newsignal  "See Demo Scripts and Files"	mbuttons -q 1 -X0 -Y 350 \\	-w"Demo Configuration Files" -i"demo" \\	-b1 demofiles.BM.fi.ipNote that \fImbuttons\fP is run in the foreground, so that\fIrundemo\fP does not proceed until \fImbuttons\fP terminates.  Theidea here is an exit from \fImbuttons\fP (when the user clicks onQUIT) signifies termination of the application.  (Of course, thisbehavior may differ from application to application.).npAfter \fImbuttons\fP terminates, \fIsend_xwaves\fP (1\-\s-1ESPS\s+1)instructs \fIxwaves\fP+ to run a termination command file(\fIdemoquit.WC\fP) that detaches \fIxspectrum\fP and quits\fIxwaves\fP+.  .npRemoves various temporary files in the output directory.  (Other applications might leave these in place.)  .sh 2 "Organizing the Sources"  .lpRather than keeping the sources for such an encapsulated application in a set of directories that mirror the structure of the installed application (e.g., as described above), it is better to keep them in a flat directory with a Makefile that creates the various subdirectories and installs into them.  .lpTo show how this is done, we have included the sources for theinstalled \fItestsignal\fP demo.  You can find them in$ESPS_BASE/src_examples/xig/testsignal.  Notice that all of the ASCIIfiles (which we control using SCCS) are at the same (flat) level, and that all of the binary files (in this case only one (binary_files/).  (end)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?