[Scummvm-devel] MidiChannel methods

A. Milburn fuzzie at users.sourceforge.net
Mon May 9 15:52:25 CEST 2011


Hi all,

Some rambling about MidiChannel, about which I may have completely
misunderstood:

Back in 2002, in revision 973164a7, the MidiChannel class was created,
with a whole bunch of (pure) virtual methods for handling control
changes. They seem to (still) only really be used by iMuse, just as a
shortcut? Some are used internally by the Adlib driver (like pitchBend).

Later (2003), in a722d060, various default implementations for most
of those methods were added, calling controlChange() with the relevant
parameters.

The Adlib driver implements all of the methods (sometimes as an empty
function), and then has a switch statement in controlChange which calls
the individual functions (or in the send() function, for things like
pitchBend). Other drivers implement things directly in controlChange
etc.

All this confuses me terribly, trying to write new drivers, especially
since there are still functions which are pure virtual. But I'm not
really too familiar with any of the code, obviously.

Is it important that things are written this way? Can we simply remove
the base class methods and call controlChange/send directly if necessary?
Perhaps adding some constants too? (I would be happy to do the work.)
Or perhaps the methods could be made into non-virtual helper methods?

- fuzzie




More information about the Scummvm-devel mailing list