xig.doc

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

DOC
661
字号
       XIG NOTE                                                        page 6            xwaves+ display server.  It is also used by xwaves+ in  determin-            ing  the  port on which to listen.  If WAVES_PORT is not defined,            than a compiled-in default is used.  This is the  default  socket            that  xwaves+  listens on when started in server mode (-s).  If a            non-default socket is to be used, it  is  specified  to  xwaves+,            send_xwaves  (1-ESPS),  and  send_xwaves  (3-ESPS)  by  means  of            WAVES_PORT.  Note that send_xwaves (1-ESPS) and xwaves+ also have            a -p option that can be used to override WAVES_PORT.       BBOX_QUIT_BUTTON            If this variable is defined, it forces  a  "QUIT"  button  to  be            included  at  the  top of every button panel created via exv_bbox            (3-ESPS).   This  includes  button  panels  created  by  mbuttons            (1-ESPS),  fbuttons (1-ESPS), and the xwaves+ command make_panel.            The variable has  no  effect  if  a  quit  button  was  specified            directly  using the -q option to mbuttons or the quit_button key-            word of the xwaves+ command make_panel.       DEF_HEADER            If defined when ESPS programs or xwaves+ encounters a  headerless            file, DEF_HEADER specifies a default header to be used. Note that            the value of DEF_HEADER relevant for xwaves+ is the value in  the            environment when xwaves+ starts up.       3 .  COMBINING AND ENCAPSULATING THE XIG FEATURES       The demos that are accessible from the panel put up by edemos (1-ESPS)       all  serve as examples for how to make use of the facilities mentioned       above.  They operate in a manner that encapsulates an application  and       presents it to the user with an application-specific user-interface.       As 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.       3 .1 .  Directory Organization       The testsignal directory is organized as follows:          % ls $ESPS_BASE/newdemos/testsignal          README  bin/    files/  menus/   params/  rundemo*  wcommands/         rundemo        Users start  up  the  application  by  invoking  this                        script.         README         This is an ASCII file containing a brief overview  of                        the application.         bin            This is a directory  containing  executable  programs                        and scripts needed by the application.       1.2                           ERL1/22/93       XIG NOTE                                                        page 7         files          This is a directory containing input files needed  in                        the  application,  including the xwaves+ startup pro-                        file.         menus          This is a  directory  containing  (olwm-format)  menu                        files needed in the application.  Such files are used                        by the programs fbuttons and mbuttons,  and  also  by                        the xwaves+ command make_panel.         params         This is a directory containing ESPS  parameter  files                        needed in the application.         wcommands      This is a directory containing xwaves+ command  files                        needed in the application.       3 .2 .  How it Works       As mentioned above, users start the application by running the  script       rundemo.   (In  the  case of testsignal, this is often done indirectly       via a button on a demo panel.)  To understand  how  it  works,  it  is       helpful  to  run the demo now.  Click on "See Demo Scripts and Files",       which brings up another panel, and then  click  on  "rundemo  (startup       script)"  in the new panel.  You can then track the following descrip-       tion of rundemo's actions (when appropriate, click on additional  but-       tons to see other files):       (1)  Creates or checks a directory that will be used for output files,            and  exports  an  environment variable with the full path to that            directory.  Testsignal is an example of a multi-user  application            that uses a set of standard, read-only, input files for everyone,            but that also needs to write output files that are user-specific.            To  handle  this  rundemo  takes a single argument: the path of a            writable directory that can be used for  output  files.   If  the            argument  is missing, rundemo sets it to a unique subdirectory of            /usr/tmp.       (2)  Sets and exports  environment  variables  for  various  ESPS  and            xwaves+ paths.  Most of these cause the application to get menus,            parameter file, command files, and executables from the subdirec-            tories below rundemo.       (3)  Creates a unique xwaves+ server port number and  exports  it  via            WAVES_PORT.       (4)  Runs bin/guess_audio to try and set up output  D/A  according  to            what is available.       (5)  Modifies a standard  xwaves+  profile  (files/waves_pro)  to  set            output_dir  to  the  output  directory  determined by (1), above.            (The resulting profile is written to that directory.)       (6)  Starts xwaves+ in server mode, using the xwaves+ profile  created            by  (5).   The  init_file  global is set so that the command file       1.2                           ERL1/22/93       XIG NOTE                                                        page 8            wcommands/demoinit.WC is run when xwaves+ starts up.   This  com-            mand file does the following:              +  reconfigures the xwaves+ menu;              +  starts the attachment xspectrum;              +  brings up two xwaves+ control panels, one for mouse bindings                 and one for miscellaneous controls.              +  sets xspectrum to display using harmonic cursors and to com-                 pute using the fast modified Burg method;              +  puts up an initial test signal (files/sample.sd)              +  computes an initial spectrum;              +  puts up the text of the README file describing the  applica-                 tion            Note that xwaves+ is started up in the background,  so  that  the            rundemo script proceeds.       (7)  Puts up an application control panel using mbuttons (1-ESPS) run-            ning  on the menu file tsignal.BM.  (Other applications use fbut-            tons (1-ESPS); see the timitdemo, for example.)   The  menu  file            tsignal.BM yields the following buttons:            QUIT exits mbuttons (and the application)            README                 puts up the README file (again)            Setup Audio Output                 this is a button menu with selections for  different  output                 options            Generate New Test Signal                 this invokes  the  script  bin/newsignal,  which  kills  the                 current  signal  displays,  uses exprompt (1-ESPS) to prompt                 the user for new signal and noise parameters,  computes  the                 new  signal plus noise, displays the signal, and computes an                 initial spectrum;            see Demo Scripts and Files                 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;            As an example of the simplicity of the configuration  files  used            by  mbuttons,  fbuttons, and the xwaves+ command make_panel, here            is the text of the file that creates the buttons described  above            (menu/tsignal.BM):       1.2                           ERL1/22/93       XIG NOTE                                                        page 9              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            Note that mbuttons is run in the foreground, so that rundemo does            not  proceed until mbuttons terminates.  The idea here is an exit            from mbuttons (when the user clicks on QUIT)  signifies  termina-            tion  of  the  application.  (Of course, this behavior may differ            from application to application.)       (8)  After mbuttons terminates, send_xwaves (1-ESPS) instructs xwaves+            to  run  a  termination  command file (demoquit.WC) that detaches            xspectrum and quits xwaves+.       (9)  Removes various temporary files in the output directory.   (Other            applications might leave these in place.)       3 .3 .  Organizing the Sources       Rather 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.       To show how this is  done,  we  have  included  the  sources  for  the       installed     testsignal    demo.     You    can    find    them    in       $ESPS_BASE/src_examples/xig/testsignal.  Notice that all of the  ASCII       files  (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)       1.2                           ERL1/22/93       XIG NOTE                                                       page 10       1.2                           ERL1/22/93

⌨️ 快捷键说明

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