I am having trouble converting from one format to the other. I don’t know at this point which to commit to.
When I use the @class IGOEController then I have to convert all the OpenEars routines which are written in the @implementation format. I can covert the simple ones, but how do I convert this:
-(void) pocketsphinxDidReceiveHypothesis:(NSString *)hypothesis recognitionScore:(NSString *)recognitionScore utteranceID:(NSString *)utteranceID {
This uses named parameters, and I don’t see how to duplicate that in the C-style function calls.
If I convert the other way, it does not seem to recognize my functions. Particularly, this structure fails:
// Functions in library
const luaL_Reg kVTable[] =
{
{ “loadOE”, loadOE },
{ “sttOn”, sttOn },
{ “sttOff”, sttOff }
{ NULL, NULL }
};
The compiler says ‘Use of undeclared identifier’ for each routine, meaning it does not see the routine declarations:
- (void)sttOn:(lua_State *)L {
NSLog(@“turn on OE”);
}
- (void)sttOff:(lua_State *)L {
NSLog(@“turn off OE”);
}
- (void)loadOE:(lua_State *)L {
I’ll keep digging into how to do each in the other format, but let me know if you have a recommendation.
It still seems like so much extra coding to connect to a Lua listener (I only ever raise events with simple calls, not using listeners). I just wish there were a simple way to declare an Objective-C function an event listener, as simple as it is in Lua. Oh, well.