Module.h
All modules you create should subclass from Module.h. Module.h contains two data items that are defined when the instance is initialized:
TheModuleController is the instance that "speaks" to modules, using the protocol ModuleProtocol
. You don't need to know anything more about the Module Controller other than that it is responsible for loading, maintaining, and communicating with modules, and that it is your gateway to communicating with Resound.
TheModuleMenuNode is the root node of your node tree for menu items you want to create in Resound's Modules menu. This is initially set to NULL--you are responsible for setting it a ModuleMenuNode, and setting up that node and its subnodes. For more information on this, see ModuleMenuNode.h
. Always set up menu node information by overriding init, but remember to call [super init] first.
There are three chief methods in Module:
init: where you set up your ModuleMenuNode. See above.
setModuleControllerTo: Resound calls this to set up TheModuleController. You should ignore this call.
getModuleMenuNode: Resound calls this to get your ModuleMenuNode. It is called soon after init:, so be sure to have your node set up by then.
In addition, Module provides overridable auxillary methods to automatically inform your module about changes in the system.