Menu items don't come up for generated voice commands

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Menu items don't come up for generated voice commands

david_misterhouse
 Hi,
I use the code below to generate voice commands for my lawn sprinklers. The problem is these commands don't end up in the auto-generated menus. How do I get these voice commands into the menus?
Thanks,
David Satterfield

if ($Reload) {
    print "Generating Voice commands for all zones\n";
    my $object_string;
    for my $object_name (keys %zones) {
        my $command = $object_name;
    $object_name =~ s/ /_/g;
    $object_name = lc($object_name);
        my $object_name_v = '$'. $object_name . '_v';

    $object_string .= "use vars '${object_name_v}';\n";
    if ($command eq 'Pool') {
        $object_string .= "$object_name_v  = new Voice_Cmd 'Run $command for [1,2,15,30,60,120,240,360,720] minutes';\n";
    }
    else {
        $object_string .= "$object_name_v  = new Voice_Cmd 'Run $command for [1,2,5,10,15,20,30] minutes';\n";
    }

    $object_string .= &store_object_data($object_name_v, 'Voice_Cmd', 'Sprinkler_Items', 'sprinkler_commands');
    }

    eval $object_string;
    print "Error in sprinkler_item_commands: $@\n" if $@;
}


Bring words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
Reply | Threaded
Open this post in threaded view
|

Re: Menu items don't come up for generated voice commands

Bruce Winter
David Satterfield wrote:
>  Hi,
> I use the code below to generate voice commands for my lawn sprinklers.
> The problem is these commands don't end up in the auto-generated menus.
> How do I get these voice commands into the menus?

I'm not sure how best to do this.  Maybe by using noloop=start/stop,
rather than reload, to pull the code out of the main loop, it would work
better?

If all you needed was to build Voice_Cmd objects based on a variable,
you could create the var in a noloop segment, then reference it in a
normal Voice_Cmd, like we do in code/common/mp3.pl, with $mp3names.

Bruce


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365