Galaxy Communicator Documentation:

Binary data example

License / Documentation home / Help and feedback

In this example, we demonstrate how to use the binary data object.

This example can be found in the distribution in contrib/MITRE/examples/binary_data.

Source fiiles

audio_binary.c: routes 8-bit audio data from itself to itself, using a binary object. Dumps the result to the audio device. Compare this to the brokering version.

data_binary.c: creates a data encoding and decoding for a simple structure and passes it through the Hub using binary objects.

mgal_data_binary.c: creates a data encoding and decoding for two simply structures and passes them through the Hub using the MITRE facility for manipulating binary objects.

Running the example

All configurations in this example can be accessed by invoking the process monitor, as follows.
Unix

% cd <root_of_GC>
% ./contrib/MITRE/tools/bin/process_monitor contrib/MITRE/examples/binary_data/binary.config

Windows

C:\> set GC_HOME=<root_of_GC>
C:\> python %GC_HOME%\
contrib\MITRE\tools\src\process_monitor\process_monitor.py %GC_HOME%\contrib\MITRE\examples\binary_data\binary.config
In addition, on Unix, we generate the following scripts.

audio.csh: runs the audio_binary server and the Hub, using the audio.pgm program file.

binary.csh: runs the data_binary server and the Hub, using the binary.pgm program file.

mgal_binary.csh: runs the mgal_data_binary server and the Hub, using the binary.pgm. program file.

Language bindings

The python/ subdirectory contains Python versions of the audio_binary, data_binary and mgal_data_binary servers. These servers are completely interchangeable with the C versions. In order to play with them, you can substitute them into the scripts.

The acl/ subdirectory contains an Allegro Common Lisp version of the audio_binary server. This server is completely interchangeable with the C version. In order to play with it, you can substitute it into the script.

The java/ subdirectory contains Java versions of the testaudio and echo servers. These are interchangeable with the C versions. In order to play with them, you can substitute them into the scripts. However since they use /dev/audio to play sounds they should only work on sparc-solaris machines.

Compilation

On Unix, typing "make" in this directory will create the servers, MIT-style Makefiles, scripts and Python, Java and Allegro Common Lisp servers.

The C version of this server contains a MSVC workspace for Windows, which is also included in the toplevel MSVC workspace for the Galaxy Communicator distribution.

Discussion

See the documentation on binary objects and the documentation on the MITRE binary object tools.


License / Documentation home / Help and feedback
Last updated August 8, 2002