Channel


Class Base.Channel

generate/icobasech.jpg

An abstract MIDI channel component class to implement common attributes and behavior of its subclasses.

Class Usage

Because this class is abstract, the users will not be able to create any object from it; therefore, no part can be created from it, either. The users will create channel components (objects and parts) from the subclasses of this class.

Class Attributes

Class Functions

Special Notes for Developers

Against object encapsulation rules, the above Evaluation function accesses the MIDI Data attribute not defined here but in the subclasses (see below). This is very dangerous in most programming practices because the in-process DLL will crash with an access violation whenever the function manipulates an instance that is created from this class. SansGUI provides developers with a safe guard, which is to set this class abstract so that no instance of this class can be created by the user. Why do we allow this in the first place? Because we can implement the common function in this parent class and the subclass functions can simply call this parent class function. In this particular case, we are sure that all subclasses have the MIDI Data attribute. Why didn't we put MIDI Data attribute in this class? Because the MIDI Data attributes in the subclasses have different measuring units.

To examine the abstract class setting, double click on the Base.Channel class to obtain the class definition in a Class Properties dialog.

Port Definitions

Although this class uses the default SansGUI port definition for component classes, in which the ports are implicitly defined without connection restriction, any links created in the Project Models are simply ignored by the MIDI Player program.

Class Base.Channel.S-1..4

generate/icochannel.jpg

Classes S-1, S-2, S-3, and S-4 are component classes for creating MIDI channels in a Project Model. They are subclasses of the Base.Channel class.

Class Usage

Create a component (part) in the Canvas View to represent a MIDI channel. Enter a channel number that matches a channel in the MIDI file to be played so that the data associated with the particular channel will be recorded in the component (part). If the data curves are to be plotted in different strips, derive the components from objects of different S-n classes; otherwise, group them into the same S-n class.

Class Attributes

In addition to the class attributes inherited from class Base.Channel, the S-1 through S-4 classes contains an attribute:

Artificial measuring units, Strip-1 through Strip-4, are assigned to the MIDI Data attributes in the S-1 through S-4 classes. With these different units, the user can create channel components from the classes in such a way that data curves from the same class will be plotted in the same strip while those from different classes will be plotted separately.

Class Functions

Although there are measuring unit differences in classes S-1 through S-4, the code in the Evaluation function stays the same. The units are introduced mainly for SansGUI charting purposes.

Port Definitions

Same as the parent class, Base.Channel, described above.

See Also

For details of the MIDI Message Object, see Class Collection.MIDI for its descriptions.

Consult the Developer's Corner section for how the program modules work.

 



Welcome to MIDI Player for SansGUI MIDI MIDIplay Simulation Control

MIDI Player for SansGUI Version 1.0

Copyright © 2002-2003 ProtoDesign, Inc. All rights reserved.

http://protodesign-inc.com