PDA

View Full Version : "repeat last command"



Ron
October 13th, 2002, 12:55 PM
Ingo, the approach outlined by Ichtus might work if the eventstring that are sent from the commandline (GIRDER events indeed) are also assigned to all the commands.

A plugin can fake events, because when it sends an event it also specifies the plugin number. To get a hold of the last sent plugin ID the plugin can monitor the events by using the Event Notification mechanism.

Ron
October 13th, 2002, 12:55 PM
Yeah I can make the plugin ID available in a variable. The source to the userevent plugin is available, don't let Mark do all the work :-)

Mark F
October 13th, 2002, 12:55 PM
You need to be careful if you are going to start stealing stuff from the variable name space. Lots of users and lots of variables already defined. :)

Perhaps a naming convention would help? All variables of the form GIRDER_* belong to Ron and Girder?

I'll start thinking about how to do this.

Ingo
October 13th, 2002, 12:55 PM
Wow Icthus this is confusing... I'll try to explain a different approach. Lets hope its easier to understand (and works... see below).

- make sure you have the user event plugin loaded.
- create multigroup and learn a girder event to it. make it react on any event.
- if eventstring is not equal to the one that triggers the repeat then
save the current eventstring to a variable:
string lastevent;
lastevent = EventString;
- create a second command, learn the 'repeat' key to it.
- make this command trigger a user event using the saved lastevent as new eventstring.


this might work, but I'm not shure... you can either give it a try or wait for Ron's answer ;-( (sorry, this only came to my mind while writing this...)

Ron,
would it be possible to save the Device Number and recreate the event using the user event plugin but using the old (and now faked) device number?
the stuff above probably won't won't work due to device numbers, right?

Ingo
October 13th, 2002, 12:55 PM
A plugin can fake events, because when it sends an event it also specifies the plugin number. To get a hold of the last sent plugin ID the plugin can monitor the events by using the Event Notification mechanism.

ok, so to make my aproach work you would have to make the plugin ID available as a variable and Mark would have to change his user event plugin to support setting the plugin ID via a variable.....
ok, the plugin ID could be set using an event that is triggered by all events cerated by a specific plugin.
anyway, what do you think about adding the plugin ID as a variable? this would allow flexible filtering of events an trigger a user event based upon these filters.....

Ingo
October 13th, 2002, 12:55 PM
Yeah I can make the plugin ID available in a variable.

thanks. for everything.


The source to the userevent plugin is available, don't let Mark do all the work :-)

I know, and I would give it a try if it was coded in VB... don't know enough c/++ ... (maybe I should start learning it...)

Icthus
October 13th, 2002, 12:55 PM
Hmm. There may be an easier way than this (this is a little time consuming to set up), but it works.

Put each of the commands that you want to be able to repeat in their own multigroup. Learn the event that you want to run this multigroup. Then, create a new Girder Event eventstring for the same multigroup. Do this by selecting the multigroup. Then, select Girder Event from the event drop down. Then push the Learn Event button. Type a meaningful name in the box (such as open_winamp) and press Select.

You should now have an eventstring, which says open_winamp in the "LCD" in the top right.

Now, add a command to your multigroup. Go to the Girder action tab and select "Variable Manipulation Script" from the drop down list. In the "Icon / Device" box, type:

string last_cmd;
[last_cmd] = "open_winamp";

Press Apply. Where it says "open_winamp", make this whatever name you gave the event earlier. Make sure you have a different name for each command you have.

This will store the string "open_winamp" in the variable named last_cmd.

Now, make a seperate command (not under this multigroup) to repeat the last command, and assign the event to your remote button. Then, go to the "O.S." action tab, and select "Execute" from the drop down box.

In the "File" box, type the path to your Girder executable. If you used the default (for Girder 3.2), it should be "C:\Program Files\girder32\Girder.exe". You can also use the browse button to find it.

Now, type "-eventstring [last_cmd]" in the "Step Size" box. Press Apply.

Now, this command will repeat the last command that you ran.

Like I said, this will take some time to do, of course depending on how many commands you have.

Hope this helps. By the way, what are you planning to do with this? Just curious - I'm always looking for new things I can do with Girder.

Icthus
October 13th, 2002, 12:55 PM
Wow Icthus this is confusing

Sorry. I thought I explained it good. What wasn't clear?

In response to other comments: Like I said before, this was just one way I thought of (and it worked fine for me). There are probably better ways, ie. using a plugin.

joebob227
October 13th, 2002, 12:55 PM
is there a way to make a button repeat the last command you gave girder?

thx

joebob227
October 13th, 2002, 12:55 PM
Hope this helps. By the way, what are you planning to do with this? Just curious - I'm always looking for new things I can do with Girder.

thanks everyone for the ideas, I'll try to get something going tonite.
I put all the zoomplayer functions into an osd and sorted them into submenus, but sometimes when you want to get at a fn you don't use a lot it's buried way in there

for example increase brightness is in 2 levels and since you generally want to hit it 10 or 20 times a repeat cmd is a good option.

thx again
- joebob