Next: , Previous: Musical Analysis, Up: Top



8 Producing printed output

The Ringing Class Library provides a flexible mechanism for producing printed output of rows, methods and lines. The way this mechanism is designed means that the low-level details of printing are hidden from the programmer. Currently the classes in the library support output in PostScript and PDF formats, and the modularity of the printing system makes it easy to extend the library to provide other output formats.

Basic printing is provided in two classes: the printpage class and the printrow class. The first of these deals with placing text and other objects directly on the page; the second allows for formatted output of rows and lines. These classes are both pure virtual classes, which are specialised by subclasses to allow for different output formats.

Printing of whole methods is accomplished by the printmethod object. This is not as flexible as the more generic functions of the lower-level printing objects, but exists to provide a quick and easy way to print out methods in a moderately variable format.

There are certain rules which should be followed when using the printing classes. For a single printpage object, only one printrow object may exist at any one time. All printrow objects associated to a printpage object must be destroyed before starting a new page, and before destroying the printpage object. Failure to observe these rules may result in unusable output.