A) It is good to remember that no protection against errors in writing a Standard MIDI File, in terms of correct syntax, is furnished by the library: that is to say, it's up to the user to perform the writing of a Standard MIDI File in a correct way, that is to say, to follow the syntax of the Format implemented by the International MIDI Association, while any other kind of protection against any other kind of troubles, such as memory allocation failure or input/output errors, is ensured by the routines of the library. For a detailed vision, the source code is fully explained, and commented, in order to make any user able to move inside it with the maximum confort and comprehension.
B) The structure of the Unit SMFInOutProc was conceived in the way it appears owing to the existing hook among the Standard MIDI File Library and the demo Application, SMFAppl. The user of this Library will then take care of customizing the Unit SMFInOutProc (possibly the others, too), accordingly to the requirements of his own Application.
C) In order to perform a Standard MIDI File reading, the user will have to specify in the Uses section of his application the SMFInOutProc Unit , which contains the code to execute a reading loop from the Standard MIDI File to be imported; that loop then calls the opportune reading functions, which resides in the Reading Unit, hooked to it through its Uses, in which is declared the Unit R_SMFLib. Please, notice that in this application, the reading loop also performs a rewriting of the data bytes it reads, so, if you wish to use its code in another application, you can consider it as a template to your reading loop, which will in spite perform, in the opportune way, all those tasks you are concerned with. Remember, too, to deallocate the memory used, after storing the data bytes anywhere required by your application, in order to prevent memory from undesirable fragmentation.
[ Index | Glossary | Previous Paragraph | Next Paragraph ]