Columns


CUG New Releases

Sound Blaster Tools, THE Editor, and RTTI for UNIX

Victor R. Volkman


Victor R. Volkman received a BS in Computer Science from Michigan Technological University. He has been a frequent contributor to C/C++ Users Journal since 1987. He is currently employed as Senior Analyst at H.C.I.A. of Ann Arbor, Michigan. He can be reached by dial-in at the HAL 9000 BBS (313) 663-4173 or by Usenet mail to sysop@ha19k.com.

New Acquisitions

CUG 413: Sound Blaster Tools and Sound Blaster Freedom Project

CUG proudly announces two free-ware programming kits for the Sound Blaster digital audio cards on a single diskette volume. The original Sound Blaster card by Creative Labs, Inc. has become an industry standard for PC digital audio. Today, a plethora of Sound Blaster (SB) compatible cards are available from many vendors. Although SB cards have proliferated widely, the knowledge required to program and control their operation has not. Knowledge of the I/O and DMA access protocol is critical for developers creating MS-DOS based applications with SB audio. In addition to code, these two kits provide lots of hard-to-find information on SB programming.

CUG 413A: Sound Blaster Tools

David Welch (Las Cruces, NM) contributes his collection of Sound Blaster Tools in C. He provides both highly detailed information about SB programming and C code (in Borland Turbo C) to generate a variety of audio mini-applications.

This kit provides a programming specification for the Sound Blaster and Sound Blaster Pro (DSP DAC/ADC only). As a bonus, the kit also provides some information and C code on programming for the PC Speaker. Since the source code was written to furnish a basic example, it does not demonstrate high speed ADC/DAC. All examples use DMA channel 1 and I/O base adddress 220h. You may need to make slight source modifications to make it work on your PC. Sound Blaster Tools builds the following MS-DOS mini-applications, and also includes precompiled versions of the same:

Additionally, the kit includes programming specifications for various chips available to all PC compatibles: 8259 Programmable Interrupt Controller, 8254 Programmable Interrupt Time, 8237 DMA Controller, and others. Sound Blaster Tools version 4 (released 12/11/93) is now available on CUG #413A.

CUG 413B: Sound Blaster Freedom Project

Jeffrey Bird, Dept. of Electrical and Computer Engineering at the James Cook University of North Queensland (Townsville, Australia), contributes his Sound Blaster Freedom Project (SBFP). As moderator of the SBFP, he has collected an impressive array of technical information. Bird writes:

The aim of the Sound Blaster Freedom Project is to provide a cheap source of programming information for the Sound Blaster and other sound cards.Previously, programming a sound card has required a not inconsiderable investment in a developer's kit for each sound card. These developer's kits have been known to be terse and not well written. Our aim is to provide enough information to the general programmer to allow them to add sound card support to their software at minimal cost.

SBFP includes source code in C and assembler for these DOS mini-applications:

Additionally, SBFP includes technical documents on programming the FM music synthesizer chips, 8237 DMA Controller, and Sound Blaster voice file format (.VOC).

This version includes significant enhancements by Christopher M. Box, some of which are:

SBFP version 3.0 (released 01/25/94) is now available on CUG #413B.

CUG #414: THE — The Hessling Editor

Mark Hessling (Holland Park, Queensland, Australia) offers his own full screen text editor similar to IBM VM/CMS Xedit and Mansfield Software's KEDIT. The THE text editor uses both command-line commands and key bindings to operate. It has currently been ported to SUNOS 4.1.x, Xenix-386, MS-DOS (Borland C++ and MSC), Esix 4.0.3a, ATT SystemV 3.2, Linux, 386BSD, and OS/2 2.1 (MSC, C Set/2, Borland C++). The CUG distribution of THE includes full source in C and a pre-built executable for use with MS-DOS.

THE includes extensive documentation in the form of a 70-page ASCII Command Reference manual. In encylopaedic fashion, it describes each command along with its syntax, compatibility with XEDIT and KEDIT, implementation status, and pointers to related commands.

THE makes use of the powerful IBM VM/CMS REXX command language in any environment where it is available. THE uses the OS/2 REXX interpreter to execute macro files. An extensive interface between THE and REXX gives THE the complete power of REXX. Most UNIX systems provide REXX support and it's also available with DJGPP using Regina 0.05, a free REXX interpreter available from flipper.pvv.unit.no in pub/rexx. The makefile includes details on integrating THE and Regina. THE version 1.5, as released on 01/12/93, is now available as CUG #414.

CUG #415: Run-Time Type Information Library for C++

Arindam Banerji (Dept. of Computer Science & Engineering, University of Notre Dame) contributes his Run-Time Type Information library for C++. Run-Time Type Information (RTTI) is a C++ language extension proposed by the ANSI C++ committee. Although the extension is intended to be implemented as part of native C++ compilers, it may be a long time before this comes to fruition. Fortunately, Banerji's implementation of RTTI as a C++ library allows you to start taking advantage of it right away. Banerji's system is loosely based on the RTTI system demonstarted by Stoustroup in The C++ Programming Language. RTTI for C++ works only with UNIX-based C++ implementations due to file naming conventions which are incompatible with MS-DOS.

All classes in this RTTI system inherit from the CLASS base class. This scheme allows public virtual inheritance to work. CLASS provides very little functionality, but it has the RTTI scaffoldings neccessary for all users of RTTI. The narrowing facility (what allows you to go from a base class pointer to a derived class pointer) depends upon the use of CLASS.

The Type_info class is the core of the RTTI implementation. It is initialized once per derived class. The constructors accept a list of the base classes and the name of the derived class. The typeid class provides an interface to the RTTI system; users get at the RTTI thru this class. This class just acts like a pass-through for the Type_info class.

The base_iterator class is initialized with the list of base classes. base_iterator allows the clients of the Type_info class to iterate through the list of bases. RTTI also includes demonstration code for string and trace classes.

Every class that uses RTTI must incorporate some scaffolding in both its declaration and its definition. The declaration must contain the following:

RTTI for C++, as released on 11/03/93, is now available as CUG #415.