Sponsored By
Efika 5200B Project
Reggae on Efika

in category Multimedia
proposed by Grzegorz Kraszewski on 21st February 2006 (accepted on 20th March 2006)
[View Full Project]
  Improvements in multimedia.class
posted by Grzegorz Kraszewski on 28th May 2009


In any object oriented framework there are some routine tasks performed inside methods. These include argument verification, object locking, generating log messages and so on. If possible, these tasks should be performed by the master class, so subclasses implementors are not bothered with them. Reggae is no exception and I decided to move the boring parts of MMM_Pull() method to multimedia.class. I've added two new methods: MMM_PrePull() and MMM_PostPull(), which rather obvious names. Using these methods a subclass implementor (it may be any subclass using MMM_Pull, so a demultiplexer, decoder or filter) may concentrate on data processing and leave bookkeeping for multimedia.class. Advantages of this approach are: avoiding code duplication, standarization of logging and avoiding trivial bugs in subclasses (like locking object with no matching unlock). It is worth noting, the technique is fully backward compatible, all old classes continue to work. The first class adapted to the new style is new zxscreen.decoder. Updated multimedia.class 52.13 will be released soon, classes will adopt this new technique incrementally. I also plan to implement similar wrappers to MMM_Seek() and other methods, which may be simplified this way.
Genesi Network: Genesi - Main Site Power2People PowerDeveloper