From: Brent D. <br...@de...> - 2005-06-22 02:37:48
|
Attached is my current module for driving the serially-controlled A/V switchers available from http://www.inday.com/ . Let me know if these would be more appropriately named something else... What I've got works, but I have a coupe questions on MH module programming, and possibly perl programming in general: 1 - I'd like to add a class variable to the Inday class (not a global). I'd also like to allow for more than one of these devices on a given MH server. What are the best MH-friendly methods for accomplishing this? Do I need to create a new() method that calls the Serial_Item::new() and then adds the class variable? I was looking around /lib for examples but didn't come up with much. It looks like most of the MH devices are written expecting only a single instance of a given class to be created? 2 - Once we allow for multiple Inday objects, I'd like the check_for_data() method to be able to operate on instance variables. How do I accomplish this, since the hook for this calls the class function and not an instance function? Put another way, what should I change the &::MainLoop_pre_add_hook call to in order to make it call the check_for_data() subrountine as an instance method instead of a class method? Let me know if anyone has any questions about this. I'm trying to work some of this out on this module before trying to apply it to my osd232 module, which is more complex. Thanks, Brent |