WaveSurfer plug-ins are implemented in Tcl/Tk as a collection of procedures. During startup, the application will search certain system and user directories for plug-in scripts, and source them into the interpreter. The plugin script file must contain a call to the following procedure: wsurf::RegisterPlugin name ?option value? ... name is the name of the plug-in. Many of the options are used to associate event callbacks to procedures in the plug-in implementation. Note that the plug-in does not need to implement all callbacks, only the ones that are relevant to its functionality. It is advisable for all plug-ins to exist in their own namespace, with the same name as the plugin.
Most callbacks are invoked with the current widget as the first argument, and in the cases where the event refers to a pane, the pane window name will be the second argument.
callback widget pane menu subMenu x y
menu refers to the window name of the popup menu widget, subMenu is an identifier of a sub-menu, can be create or an empty string. x and y refers to the coordinates where the menu button was pressed.
callback widget pane
callback widget start end
start and <end> are given in seconds as floating point numbers.
callback widget pane time value
time is the cursor position along the time axis, in seconds. value is the cursor position along the value axis, in the pane's local units, see getBoundsProc. Both are given as floating point numbers.
callback widget start end
start and <end> are given in seconds as floating point numbers.
callback widget pane
The return value of the callback should be a list containing the time and value bounds for the plugin contents, as four elements: tmin vmin tmax vmax, where tmin and tmax are the minimum and maximum time, and vmin and vmax are the minimum and maximum values.
callback widget pane
The callback is first invoked with pane as an empty string, which allows the plug-in to supply configuration statements for the entire widget, then it is invoked once for each pane in the widget. The return value of the callback should be a string containing new-line separated configuration statements for the plugin. Configuration statements are regular tcl-statements that will, when executed, recreate the current configuration of the widget. The configuration statements should refer to the current widget as $widget
and to the pane as $<pane>. A typical configuration statement for myplugin might look something like:
$widget myplugin::addSomeFeature $pane -option1 value1 -option2 value2
callback arglistVar
arglistVar refers to a list variable name containing the command line, typically argv. The callback should remove all switches it wants to handle from arglistVar. This easiest done using the cmdline package in the Standard Tcl Library.
callback widget fileName
The callback should return a boolean value to indicate whether or not it handles the file. If a plug-in returns true, the application will not try to handle the file internally.
callback widget pane
callback widget pane
callback widget start length
start and length are given in seconds as a floating point numbers.
callback widget
callback widget
callback widget pane tempCanvas x y
tempCanvas is a temporary canvas used during printing. The plug-in is expected to re-draw the pane contents in this canvas at coordinate offset x,y.
callback widget pane
The return value should be a list of the form {name displayproc name displayproc ...}. Each name/proc pair specifies one page in the properties dialog notebook widget. name is a text string that will be displayed on the notebook tab. displayproc should be a procedure that will be invoked to render the page. This procedure will be invoked as follows:
displayproc widget pane frame
Frame is the container frame of the notebook page, into which plugin widgets will be arranged.
callback widget
callback widget pane
callback widget pane
The return value should be a boolean, indicating whether or not there is unsaved information in the pane.
callback widget fileName
The callback should return a boolean value to indicate whether or not it saves the file. If a plug-in returns true, the application will not try to save the file internally.
callback widget pane
callback widget pane t0 t1
t0 and t1 are the start and end times for the new selection, given in seconds as floating point numbers.
callback widget flag
flag is a string describing the type of change.
callback widget
callback widget
callback widget
callback widget